![]() |
Problem mit "Search"Funktion (Suche)
So mein nächstes Problem.
Also habe eben auch schon gefragt wie man mehrere "Boolean-Ausdrücke(dingens)" in eine If Abfrage reinkriegt. Das klappt so weit so gut. jetzt hab ich aber ein Problem das meine Suche (in diesem Fall) auf Form2.Listbox1 ausgerichtet ist. Kann man das irgendwie auf mehrere ListBox's "konfiguieren" falls ListBoxX.Visible? also hier mal mein Code:
Delphi-Quellcode:
also das durchsucht nur ListBox1 (fals Visible) und nicht LIstBox2 (fals visible)
procedure TForm1.SearchClick(Sender: TObject);
var i : Integer; searchUp : String; begin If ((Form2.ListBox1.Visible) or (Form2.ListBox2.Visible)) then begin //mehrere ListBoxen If Edit2.Enabled=True then begin //Zusätzliche Funktion (unwichtig) Form2.listBox1.MultiSelect := True; //evtl. Form2.listbox2.MultiSelect := True; hinzufügen? searchUp := AnsiUpperCase(Edit1.Text); //muss man wohl nix ändern for i:=0 to StrToInt(Edit2.Text) do //hier glaub auch nix ändern if Pos(searchUp, AnsiUpperCase(Form2.listBox1.Items[i])) > 0 then begin //Wie Hier Form2.ListBox2.Items[i] hinzufügen? oda per "else unten hinzufügen? Form2.listBox1.Selected[i] := true; //evtl. Form2.listbox2.Selected[i] unten hinzufügen? application.ProcessMessages; end else Form2.listBox1.Selected[i] := false; //evtl. Form2.listbox2.selected[i] := false; hinzufügen end; end; |
Re: Problem mit "Search"Funktion (Suche)
hoi,
auf alle listboxen oder nur 'mehrere' ? Ein Ansatz wäre sicherlich über Form.ComponentCount -> Component as TListbox cya |
Re: Problem mit "Search"Funktion (Suche)
Zitat:
werd ein bisschen rumprobiern aber hilfe wer natürlich trotzdem nett. |
Re: Problem mit "Search"Funktion (Suche)
versuch mal
Delphi-Quellcode:
procedure TForm1.SearchClick(Sender: TObject);
var ... ... comp_anzahl : integer ; begin for comp_anzahl:=0 to Form2.ComponentCount-1 do begin if (Form2.Component[comp_anzahl] is TListbox) and ((Form2.Component[comp_anzahl] as TListbox).Visible) then begin ... end; end; end; (ungetestet) cya |
Re: Problem mit "Search"Funktion (Suche)
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz