Autor Beitrag
Grumble
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Do 03.04.03 09:07 
Hallo,

ich habe da ein prob:
wie kann ich in einem stringgrid jede, sagen wir mal 12te zeile einfaerben?
ich gruebel da jetzt schon ewig dran rum :oops: aber mir faellt da nichts richtiges ein ... :?:
helft mir bitte

_________________
Grumble
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Do 03.04.03 09:13 
Hallo

Stichwort: OndrawCell. Such mal im Forum danach.
bzw. weil du aus dresden bist :wink:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  with sender as Tstringgrid do
    begin
      //nicht für fixierte Zellen
      if gdfixed in state then exit;
      //hintergrund
      if (arow mod 12) = 0 then canvas.brush.color := clred
                           else canvas.brush.color := color;
      //textausgeben
      canvas.textrect(rect,rect.left+2,rect.top+2,cells[acol,arow]);
    end;
end;

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Grumble Threadstarter
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Do 03.04.03 09:24 
vielen dank genau danach hab ich gesucht :D , manchmal fallen einem die einfachsten dinge nicht ein :idea:

_________________
Grumble