Autor Beitrag
Paulchengb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 39



BeitragVerfasst: Do 04.10.07 17:45 
Hallo,

ich habe mich schon um die Suche bemüht und habe da nur komplizierte Sachen mit dem OnDraw Item gefunden. Ich bin ein Anfänger und es kommt mir unnötig kompliziert vor. Mein Quellcode schaut so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if (v<=x) and (x<=b) and (v<=y) and (y<=b) and (v<=z) and (z<=b) then
      begin

      listbox1.Items.Add(floattostr (x)+ floattostr (y) + floattostr (z));
      ...
    else
      begin
      listBox1.Canvas.Font.Color := clGreen;
      listbox1.Items.Add (floattostr (x)+ floattostr (y) + floattostr (z) +' ' + 'unpassend');
      end


Bei if....soll die Ausgabe schwarz sein, wie es jetzt auch ist. Nur bei der else-Bedingung sollen die Einträge grün sein.

Was habe ich da falsch gemacht?


Moderiert von user profile iconGausi: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Do 04.10.2007 um 19:07
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 04.10.07 18:01 
Moin!

user profile iconPaulchengb hat folgendes geschrieben:
ich habe mich schon um die Suche bemüht und habe da nur komplizierte Sachen mit dem OnDraw Item gefunden. Ich bin ein Anfänger und es kommt mir unnötig kompliziert vor.

Leider ist das aber genau die Lösung für deinen Wunsch. :? Schau nochmal etwas genauer hin, soo kompliziert ist das gar nicht. ;) Suche in: Delphi-Forum, Delphi-Library ZEBRAEFFEKT

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Mike19
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 256

Win XP, Vista, Win 7
Delphi 2005, Turbo Delphi
BeitragVerfasst: Do 04.10.07 18:04 
Hallo,

warum listBox1.Canvas.Font.Color := clGreen; ?

Es reicht doch ListBox1.Font.Color:=...;


Und dann noch ein Repaint und schon müsste es klappen

Micha

Moderiert von user profile iconNarses: Quote- durch Delphi-Tags ersetzt
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 04.10.07 18:09 
Moin!

user profile iconMike19 hat folgendes geschrieben:
Es reicht doch ListBox1.Font.Color:=...;

Und dann noch ein Repaint und schon müsste es klappen

Jain, dann ist der komplette Inhalt der Listbox Grün ;) er will aber selektiv Einträge andersfarbig haben. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.