Hallo allemaal,
Ik wil een marker in een StringGrid toevoegen per geselecteerde Cell. De marker wordt alleen maar weergegeven in Cell = 0. Andere cellen worden weergegeven in de kleur geel.
Code:
PROCEDURE TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: INTEGER;
aRect: TRect; aState: TGridDrawState);
BEGIN
StringGrid1.DefaultDrawing := False;
IF (gdSelected IN aState) THEN
BEGIN
StringGrid1.Canvas.Brush.Color := clYellow;
StringGrid1.Canvas.FillRect(ARect);
StringGrid1.Canvas.TextRect(ARect, ARect.Left + 2, ARect.Top + 2, StringGrid1.Cells[aCol, aRow]);
StringGrid1.Canvas.Brush.Style := bsSolid;
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.Rectangle(ARect.Left, ARect.Bottom - 5, ARect.Width, ARect.Bottom);
END;
END;
Doe ik wat fout of kan het niet?
Met een groet, Frans
Bookmarks