|
TDrawGrid는 OnDrawCell 이벤트 핸들러에서
문자열외에 얼마든지 그래픽을 사용하는 코딩을 할 수 있습니다.
다음은 헬프에 있는 예제입니다.
// The following code uses the bitmaps in an image list component to draw the contents of
// each cell in a draw grid. It draws a focus rectangle around the cell that has focus.
void __fastcall TForm1::DrawGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State)
{
long index = Row * DrawGrid1->ColCount + Col;
DrawGrid1->Canvas->Brush->Color = clBackground;
DrawGrid1->Canvas->FillRect(Rect);
ImageList1->Draw(DrawGrid1->Canvas,Rect.Left,Rect.Top,index);
if (State.Contains(gdFocused))
DrawGrid1->Canvas->DrawFocusRect(Rect);
}
서비 님이 쓰신 글 :
: 현재 DrawCell 이벤트를 이용하여.. 각 셀이나 값에따라서 색을 다르게 표현했습니다.
:
: 근데 TListView처럼 각 행마다 Icon을 넣을 수 있을까요?
:
: 검색을 해봤는데 셀병합 Font바꾸기 등 예제밖에없고 이미지를 넣을 수 있는건 없네요..
:
: 불가능 한가요?
|