Hi ihr da draußen,
wie kann ich mit einem FindDialog in einer ListBox suchen.
Ich hab hier mal was Probiert, aber das tut irgendwie nicht!
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| procedure TForm1.BIT_searchClick(Sender: TObject); var i: integer; gefunden: Boolean; begin If FindDialog1.Execute then if FindDialog1.FindText<>'' then begin gefunden:=False; i:=-1; while (i<ListBox1.Items.Count-1) and not gefunden do begin Inc(i); if pos(FindDialog1.FindText,ListBox1.Items[i])>0 then Gefunden:=True; end; if gefunden then ListBox1.ItemIndex:=i else Showmessage('Nixx gefunden!'); end; end; |
Schon mal danke im Voraus!
Greetz
PT
Moderiert von
Christian S.: Code- durch Delphi-Tags ersetzt.
_________________
-=the things you own, own you=-
JESUS SAVES, the rest of you takes full damage!