Einzelnen Beitrag anzeigen

ratmalwer

Registriert seit: 30. Nov 2020
15 Beiträge
 
#5

AW: Stringgrid selected ändert Farbe

  Alt 31. Mai 2023, 23:15
Danke Uwe

einfache Lösungen brauchen Zeit und liebe Mithilfe

Code:
procedure TFormMain.SG1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
  var oldColor : Tcolor;
begin
      if ARow = 0 then begin
        oldColor := SG1.Canvas.Brush.Color;
        sg1.Canvas.Brush.Color := clActiveCaption;
        sg1.Canvas.Brush.Color := clred;
        sg1.Canvas.fillrect(Rect);
        sg1.Canvas.textout(rect.left+5,rect.top+2,SG1.Cells[aCol,aRow]);
        sg1.Canvas.Brush.Color := oldColor;
      end;
end;
  Mit Zitat antworten Zitat