Autor Beitrag
rafi@work
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Mo 20.10.03 13:07 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TSocketConnectForm.ListViewDeviceCustomDrawItem(
  Sender: TCustomListView; Item: TListItem; State: TCustomDrawState;
  var DefaultDraw: Boolean);
var
  i : Integer;
begin
   if (Item=nilthen Exit; 
  with Sender.Canvas.Brush do
    if Item.SubItems[0] = 'Active' then Color:=clGreen
      else Color:=clYellow;
end;


hiermit ändere ich je nach String des ersten SubItems die Farbe. Gibt es eine möglichkeit anstelle von clGreen, clYellow etc.. Farbcodes zu verwenden? Danke für eure Hilfe!

gruss[/code]
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 20.10.03 13:46 
rafi@work hat folgendes geschrieben:
Gibt es eine möglichkeit anstelle von clGreen, clYellow etc.. Farbcodes zu verwenden?

Was verstehst du unter einem Farbcode?

Eventl:
ausblenden Delphi-Quelltext
1:
Color := $0000FF;					

Gruß
Tino
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Mo 20.10.03 13:53 
ja genau das mein ich. bei mir hats nicht gefunzt, hab das '$' -Zeichen vergessen... :? naja hauptsache jetzt klappts! Besten Danke Tino! :D

gruss
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 24.10.03 15:47 
wie müsste ich es anstellen, wenn ich jetzt für 'Unknown' Rot, für 'Ready' gelb, für 'Active' grün etc... will??

gruss
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 24.10.03 17:45 
Vielleicht die Farben mischen?
ausblenden Quelltext
1:
2:
3:
rot  = $0000ff
grün = $00ff00
gelb = $ffff00
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Fr 24.10.03 18:27 
nein,

ausblenden Quelltext
1:
2:
gelb   = $00FFFF
hellblau = $FFFF00


BGR ;)