TStringGrid에서 Selected 된 Cell의 색을 white로 바꾸려면
아래와 같이 OnDrawCell 이벤트 핸들러에서 직접 그려주면 됩니다.
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
if( State.Contains( gdSelected))
{
StringGrid1->Canvas->Brush->Color=clWhite;
StringGrid1->Canvas->Font->Color=clBlack;
StringGrid1->Canvas->Rectangle(Rect);
StringGrid1->Canvas->TextRect(Rect,Rect.left,Rect.top,StringGrid1->Cells[ACol][ARow]);
}
}
깔끔하지는 못할껀데요... 조금 수정하시면 될듯..
freebutton 은? 잘모르겠음..
그럼..
linuxman 님이 쓰신 글 :
: 안녕하세요..
: 1. 스트링 그리드에서 default 나타나는 파란색 커서 (select 됐을때 나타나는 놈..) 그놈을 아예 나타나지
: 않게 할수 있나요?
:
: 2. 자료실의 freebutton 좀 올려주실 분 있나요? ( 색깔이 있는 버튼 입니다 )
: 설치를 해도 에러는 없는데... 콤포넌트가 나타나질 않습니다...
: (색깔을 넣을수 있는 버튼이면 어느것도 괜찮습니다 )
:
: 수고하세요..
|