Board index » delphi » how to get the each cell's color of the StringGrid??
ari
![]() Delphi Developer |
how to get the each cell's color of the StringGrid??2003-11-14 12:59:44 PM delphi85 Hi, i wrote some code like follow: procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin if (ACol=1) and (Arow=1) then begin StringGrid1.Canvas.Brush.Color := clred; StringGrid1.Canvas.FillRect (Rect); end else if (ACol=1) and (Arow=2) then begin StringGrid1.Canvas.Brush.Color := clblue; StringGrid1.Canvas.FillRect (Rect); end else if (ACol=1) and (Arow=3) then begin StringGrid1.Canvas.Brush.Color := clyellow; StringGrid1.Canvas.FillRect (Rect); end end; and then, i can I get back the specifically cell's color i click? ari |