Autor Beitrag
Nomak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18


D6Ent, D7Ent
BeitragVerfasst: Di 15.02.05 22:58 
Weiss jemand wie ich ein Listview, dem ich alle paar Sekungen ein paar neue Einträge hinzufüge, bei jedem Update zum Ende scrollen kann? Danke!!

Nomak
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Di 15.02.05 23:11 
Ich schreib mir für sowas immer ne eigene Prozedur, die in etwa so aussieht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.OutputLog(strLogText: string);
begin
  ListBox1.Items.Add(strLogText);
  ListBox1.ItemIndex := ListBox1.Items.Count - 1;

  // die unschöne blaue Markierung entfernen ;)
  ListBox1.ItemIndex := -1;
end;

und dann, wenn ich was ausgeben will in der LB, nehme ich die Prozedur und greif nicht direkt auf Listbox1.items.add zu..


MfG


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
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: Mi 16.02.05 16:15 
er hat nach einem Listview gefragt ;)

bei einem Listview gibt es listitem.makevisible:
ausblenden Delphi-Quelltext
1:
2:
if listview.items.count<>0 then
  listview.items[listview.items.count-1].MakeVisible(false);


für die Listbox gehts auch kürzer, add ist eine funktion:
ausblenden Delphi-Quelltext
1:
  ListBox1.ItemIndex := ListBox1.Items.Add(strLogText);					


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)