Autor Beitrag
rn22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Sa 25.06.05 11:29 
Hallo!

Ich möchte in einer Tabelle Daten in verschiedenen Farben, Schriftarten, etc. anzeigen. Mit TStringGrid - mit dem ich bisher gearbeitet habe - geht das wohl nicht.
Kennt jemand eine Alternative?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 25.06.05 11:45 
Klar geht das mit dem Standard-StringGrid! Du musst nur im OnDrawCell des StringGrids in etwa sowas reinpacken:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.STRINGGRID1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
    With (Sender as TStringGrid) Do
    begin
        Canvas.Font.Color:=clred;
        Canvas.Font.Style := Canvas.Font.Style+[fsbold];
        Canvas.TextRect (
            Rect,
            Rect.Left + 2, Rect.Top + 2,
            Cells[ACol, ARow]);
    end;
end;

_________________
We are, we were and will not be.