Hoi Frans,
Bij mij werkt dit:
Delphi Code:
procedure TForm1.StringGrid1DrawCell(Sender : TObject; aCol, aRow : Integer;
aRect : TRect; aState : TGridDrawState);
begin
If (StringGrid1.FixedCols <> 0) and (ACol=0) then
Begin
StringGrid1.Canvas.Font.Color :=clred;//Color;
StringGrid1.Canvas.Font.Style := [fsBold];
StringGrid1.Canvas.Font.Name := 'Marlett';
StringGrid1.Canvas.Font.Size := 14;
StringGrid1.Canvas.Brush.Color:=clWhite;
StringGrid1.Canvas.Rectangle(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left, aRect.Top, StringGrid1.Cells[0, ARow]);
StringGrid1.Canvas.FrameRect(aRect);
end;
end;
procedure TForm1.StringGrid1SelectCell(Sender : TObject; aCol, aRow : Integer;
var CanSelect : Boolean);
Var
R : Integer;
Begin
If (StringGrid1.FixedCols <> 0) Then
Begin
For R:=0 to StringGrid1.RowCount - 1 do StringGrid1.Cells[0,R]:=#0;
StringGrid1.Cells[0, aRow] := '4';
Row_Oud := StringGrid1.Row;
End;
end;
Ik neem aan dat je Row_Oud nog ergens voor gebruikt?
Greets,
Peter.
Bookmarks