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

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 13.06.03 14:05 
Hallo!

ich hab da ein programm wo ich mit "SocketConnect" eine Verbindung auf einen Gateway mache. Ich ermittle dann alle Geräte die an diesem Gateway angemeldet sind mit sogennanten Telegrammen (dies ist eine String-Kette). Dies mache ich mit SendText. Die Infos über diese Geräte (ID, IP, Port, Status, usw...) stelle ich in einer ListBox dar. Nun möchte ich dass die ListBox mit den Infos über diese Geräte automatisch auktualisert wird, wenn sich zum Beispiel der Status oder was auch immer ändert. Gibt es da irgendeine Update Funktion?

mfg[/delphi]
FriFra
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: So 15.06.03 15:20 
Also zuerst einmal würde ich eine ListView (Style = lsReport) anstelle einer Listbox verwenden. Dann kannst Du auch einfach herausfinden ob ein Eintrag schon vorhanden ist...
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
if ListView1.Items.IndexOf('DeineBezeichnung')>-1 then
begin
  //Eintrag gefunden
  ListView1.Items[ListView1.Items.IndexOf('DeineBezeichnung')].SubItems[0]:='Neue Eigenschaft1';
end
else
begin
  //nicht gefunden...
  ListView1.Items.Add();
  ListView1.Items[ListView1.Items.Count - 1].Caption := 'DeineBezeichnung';
  ListView1.Items[ListView1.Items.Count - 1].SubItems.Add('NeueEigenschaft1');
end;


Voraussetzung ist natürlich, dass die Caption ein statischer Wert ist...

_________________
Michael
(principal certified lotus professional - developer)
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Do 19.06.03 14:55 
Hat prima geklappt! Danke!