Haraldo
Gast
|
 |
« Antworten #1 am: 09.03.2002, 19:54:17 » |
|
so sollte es gehen. habe ich aus den Tips [font size=2 face="Courier New"][font color="#000000"]StringGrid Zellen färben
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin with (Sender as TStringGrid) do begin if (ACol = 0) or (ARow = 0) then Canvas.Brush.Color := clBtnFace else begin Canvas.Font.Color := clBlack; if ARow mod 2 = 0 then Canvas.Brush.Color := clRed else Canvas.Brush.Color := clLime; Canvas.FillRect(Rect); Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]); end; end; end;
procedure TForm1.Button1Click(Sender: TObject); begin StringGrid1.Cells[1, 1] := 'Test'; end;
[/font][/font]
|