Autor Beitrag
th3Thr1ll3r
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 31

Win XP Prof
Delphi 6 Pers.
BeitragVerfasst: Mo 31.10.05 11:23 
gut, gesucht habe ich schon, aber ich nich wircklich was gefunden...

also, wie kann ich eine ListBox durchsuchen, und alle Items, die zum gesuchten Text passen, in eine neue ListBox kopieren!


Moderiert von user profile iconAXMD: Topic aus Sonstiges verschoben am Mi 02.11.2005 um 14:53
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 31.10.05 11:31 
Items.IndexOf('Text'); gibt dir die zeile der Übereinstimmung zurück (als integer), falls es keine Übereinstimmung gibt bekommst'de -1 zurück.
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Mo 31.10.05 11:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var i : Integer;
begin
  for i := 0 to ListBox1.Items.Count -1 do
     if pos('gesuchtesWort',ListBox1.Items[i]) <> 0 then ListBox2.Items.Add(ListBox1.Items[i]);
end;

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.
th3Thr1ll3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 31

Win XP Prof
Delphi 6 Pers.
BeitragVerfasst: Mo 31.10.05 16:53 
thx!!!