(Gast)
n/a Beiträge
|
Re: ein paar Fragen zum StringGrid
11. Sep 2007, 12:01
Hallo,
zu 1:
Delphi-Quellcode:
Procedure TForm1.FormCreate(Sender: TObject);
var
TheRect: TGridRect;
Begin
[...]
StringGrid1.Selection := TheRect;
End;
zu 2:
lässt sich bestimmt auch eleganter lösen, funktioniert aber:
Delphi-Quellcode:
Procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
[...]
Begin
With (Sender As TStringGrid) Do Begin
If (Pos('nicht', StringGrid1.Cells[ACol - 1, ARow]) = 1) Or
(Pos('nicht', StringGrid1.Cells[ACol, ARow]) = 1) Or
(Pos('nicht', StringGrid1.Cells[ACol + 1, ARow]) = 1) Then Begin
Canvas.Brush.Color := clRed;
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 2, Rect.Top + 1, StringGrid1.Cells[ACol, ARow]);
End;
End;
[...]
End; // OnDrawCell
|
|
Zitat
|