相应tstringgrid 的drawcell事件!加一个 ImageList控件放上图片
var
sg:tstringgrid;
procedure TForm1.sgDrawCell(Sender: TObject;
ACol, ARow: Integer;
Rect: TRect;
State: TGridDrawState);
var
index:integer;
begin
index:= ARow * sg.ColCount + ACol;
sg.Canvas.FillRect(Rect);
ImageList1.Draw(sg.Canvas,Rect.Left,Rect.Top,index);
//if (State.Contains(gdFocused))
sg.Canvas.DrawFocusRect(Rect);
end;