Autor Beitrag
thenewone
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Di 29.03.05 23:29 
Hallo Leute!

Ich brauch mal wieder eure Hilfe :-(

Ich möchte, wenn eine bestimmte Aktion true ist, das diese Zeile, in der ich
mich grad im StringGrid befinde rot eingefärbt werden soll.

Könnt ihr mir da helfen ??

Vielen Dank im voraus.

greetz
oliver


Moderiert von user profile iconraziel: Topic aus Multimedia / Spiele / Grafik verschoben am Do 31.03.2005 um 09:36
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 29.03.05 23:33 
dazu mußt die option goRowSelect jedenfalls auf TRUE setzten

_________________
Gruß Harry
Et spes me per dies sine te ducat et amor me ferat, si dolor spem tollit.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 29.03.05 23:44 
Hallo,

ich denke, das dass Dir weiterhilft:
Suche in: Delphi-Forum, Delphi-Library Stringgrid Zellen Farbe ändern

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
thenewone Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Mi 30.03.05 08:41 
Hi!

Danke soweit schon einmal für die Tipps.

@Lannes
Scheint so weit zu funktionieren, aber mir sagen die Übergabewerte alle nich wirklich was :-(
Wie würde denn der Call dazu aussehen?

Ich möchte immer nur an einer bestimmten Stelle im Programm diese Funktion aufrufen, die mir dann die Spalte "0" rot einfärbt.

Vielen Dank im voraus
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 30.03.05 23:46 
Hallo,

Zitat aus der Delphi-Hilfe:
Das Ereignis OnDrawCell tritt ein, wenn eine Zelle des Gitters gezeichnet werden muß.

Hier mal ein kleines Beispiel :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
 procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  if CheckBox1.Checked = True then
    with StringGrid1 do
      if gdFocused in State then
        begin
        Canvas.Brush.Color := clred;
        Canvas.FillRect(Rect);
        end;
end;

Das Beispiel färbt die aktuelle Zelle rot, abhängig von der Checkbox.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )