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

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 07.11.03 11:30 
Hallo!

Wie kann ich in einer Zeile einer ListView das Icon ändern wenn z.b. die dritte Spalte den wert 'Active' hat?

mfg
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Fr 07.11.03 12:12 
Hallo,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
with ListView1 do
begin
  if (Items[0].SubItems[1]='Active') then Items[0].ImageIndex:=2
    else Items[0].ImageIndex:=1;
end; // if


Zu beachten ist, dass die SubItems ab der 2. Spalte der Listview zählen. Wie bei Delphi üblich beginnt die Zählerei auch bei 0. D. h. die Spalte 2 hat den SubItem 0 usw.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)