Autor Beitrag
ralfi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 153



BeitragVerfasst: So 05.10.03 00:26 
Hallo!

Ich habe ein ListBox mehrere Items. Wie kann folgende Suchfunktion realisieren?: man gibt in einer Edit ein Wort ein, drückt auf "Suchen", und alle Items, die dieses Wort haben, in eine zweite ListBox hinzufügt werden.

Danke!
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: So 05.10.03 08:11 
listbox1.items.indexof , wenn das Wort = item ist (groß klein wäre egal). Sonst die einzelnen items mit pos abklapperen (auf groß klein-schreibung achten)

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 06.10.03 08:29 
Hier mal ein Beispiel (nicht getestet):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Var
  Loop: Integer;
Begin
  For Loop := 0 To ListBox1.Items.Count -1 Do
    ListBox1.Selected [Loop] := Pos ('suchtext', ListBox1.Items [Loop]) > 0;
End;

Gruß
Tino