Registriert seit: 9. Jul 2010
Ort: Köln
667 Beiträge
Delphi 2010 Professional
|
AW: StringGrid Zeile einfärben
28. Dez 2014, 13:57
Oder noch kürzer:
Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell( Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState );
begin
StringGrid1.Canvas.Font.Color := clblack;
if (gdSelected in State) or (StringGrid1.Cells[3, ARow] = '2') then
StringGrid1.Canvas.Brush.Color := clRed
else if StringGrid1.Cells[3, ARow] = '1' then
StringGrid1.Canvas.Brush.Color := clYellow;
StringGrid1.Canvas.FillRect( Rect );
StringGrid1.Canvas.TextRect( Rect, Rect.Left, Rect.Top, StringGrid1.Cells[ACol, ARow] );
end;
|
|
Zitat
|