Autor Beitrag
BastardOp
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41

Windows XP Prof. SP2
Delphi 7 PE Delpi 2005 PE
BeitragVerfasst: Mo 13.06.05 20:59 
Hi

ich wollte mal frage ob und wie es geht das ich ein einzelnes Item in eine TListView in einer bestimmten Farbe einfärb wenn ein bestimmter Inhalt vorliegt.
Habe es bereits hinbekommen jede zweite Zeile einzufärben.
ich hab meine TListView auf vsRecord

Ich hoffe ihr könt mir helfen

MfG
BastardOp
tobiaskr
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 14.06.05 07:38 
Hallo,

ich denke mal, das du beim Einfärben jeder zweiten Zeile mit den CustomDraw-Ereignissen gearbeitet hast. Alles was du machen musst ist, an der Stelle an der du auf den geraden oder ungeraden Index abfragst, auf deine neue Bedingung abzufragen.

Gruß Tobias
DJ-DJ
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

Win 98; Win XP Home
Delphi 6 Personal
BeitragVerfasst: Fr 24.06.05 18:01 
Hi..ich wüsste ganz gerne, wie man überhaupt eine Zeile bzw. ein item einfärben kann...denn ich bräuchte sowas auch mal...wäre super nett, wenn du mal beschreiben könntest, wie du das hinbekommen hast. Grüße David
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: Fr 24.06.05 18:05 
Hast du denn schon mal im forum gesucht? insbesondere zum Färben gibts unmengen threads.
Was am besten ist, hängt letzenendes davon ab, was genau du färben willst.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
DJ-DJ
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

Win 98; Win XP Home
Delphi 6 Personal
BeitragVerfasst: Sa 25.06.05 10:33 
ich würde gerne - in einem Mediaplayer, der ein LV als Playlist benutzt - den Eintrag, der gerade abgespielt wird rot einfärben, bzw halt die Schrift, so dass es ähnlich ist wie bei Winamp etc. das alle Eintrge eine bestimmte Farbe haben und der, der abgespielt wird eine andere.
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: Sa 25.06.05 15:46 
Hallo

wenn es nur die Schrift ist, langt das setzen der Fontfarbe im oncustomdrawitem-Ereignis. Das setzen der Font-Farbe reicht, es ist nicht notwendig, das komplette Item selbst zu zeichnen. Mit hilfe des übergebenen Items, kannst du betimmen, wie die Farbe sein soll (z.B. über den item.index und bei abspielen des Liedes sich den index des Items merken und bei oncustomdrawitem vergleichen und entpsrechend reagieren)

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
DJ-DJ
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

Win 98; Win XP Home
Delphi 6 Personal
BeitragVerfasst: So 26.06.05 11:08 
Hey, jo, danke funktioniert...hab einfach canvas.font.color bei dem entsprechendem Item geändert..Dankeschön!