|
OnDrawCell 이벤트에서 해주면 됩니다.
아래는 코드는 빌더 헬프의 예제입니다.
헬프를 찾아보면 미흡한 부분은 많지만 그래두 알 수 있을 만큼은 나오는데....
헬프의 생활화...^^
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State)
{
long index = Row * StringGrid1->ColCount + Col;
StringGrid1->Canvas->Brush->Color = clBackground;
StringGrid1->Canvas->FillRect(Rect);
ImageList1->Draw(StringGrid1->Canvas,Rect.Left,Rect.Top,index);
if (State.Contains(gdFocused))
StringGrid1->Canvas->DrawFocusRect(Rect);
}
요쿠르트 님이 쓰신 글 :
: 컨스텀 드로우 이벤트에서 작업하라고 하셨는데..
: StringGrid1 event에 그런 이벤트 없던데요?? 영문으로 자세히 좀..--;
:
: 그리고 코드는 아래 제가 생각한 코드가 맞나요???
:
:
: 요쿠르트 님이 쓰신 글 :
: : stringGrid에서 특정셀의 배경색을 바꿀려면 어떻게 해요??
: :
: : 대충 StringGrid1->Cell[1][1]->color 뭐 이렇게 생각했더니 안되네요..?
|