Autor Beitrag
Stoffel1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 219

Win NT, Win 2000
D6 Prof
BeitragVerfasst: Mi 09.07.03 09:23 
Hallo

ich färbe mit folgendem Code jede 2. Zeile meiner Listview ein (bessere Übersicht).

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
  with ListView1.Canvas.Brush do
  begin
    if item.Index mod 2 = 0 then Color := clwhite;
    if item.Index mod 2 = 1 then Color := $00FFF5EC;
  end; 
end;


Wenn ich allerdings einzelne Items aus der ListView lösche habe ich das Problem dass die Items zum Teil nicht richtig eingefärbt sind. Also zwei weiße hintereinander usw. Versteht ihr? Mir fällt beim besten Willen kein Lösungsweg ein. Habt Ihr ne Idee? :?

Gruß und Danke im Vorraus,

Stoffel
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 09.07.03 09:28 
Hallo,

versuche mal ein
ausblenden Delphi-Quelltext
1:
ListView1.Repaint;					

nach dem löschen der Zeile.

Gruß
Klabautermann
Stoffel1984 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 219

Win NT, Win 2000
D6 Prof
BeitragVerfasst: Mi 09.07.03 09:38 
Vielen Dank Klabautermann! Funktioniert prima.
Manchmal sieht man den Wald vor lauter Bäumen nicht...
Das ich da nicht selbst drauf gekommen bin :autsch:

Danke nochmal,

Stoffel