[Lazarus] String grids

kmi at vgdata.dk kmi at vgdata.dk
Wed Feb 29 16:39:11 CET 2012


> Is there any way (hopefully easy) to change the background colour of a
> specific cell in a stringgrid?
>
procedure TForm1.SG1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
  aState: TGridDrawState);
begin
  SG1.Canvas.brush.color := clWhite;
  If (aCol = 4) and (aRow = 1) Then
      SG1.Canvas.Brush.color := clRed;
end;
The PrepareCanvas may be used.

/Kaj




More information about the Lazarus mailing list