Autor Beitrag
qball
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Di 03.06.03 18:28 
Wie kann ich ein Item aus einer Listbox anwählen und in eine variable speichern?
Allgemein: Wie kann ich auf ein bestimmtes Item einer Listbox zugreifen?

Mit Items.Text hängt sich die Prozedur an folgender Stelle auf:
ausblenden Quelltext
1:
while not (lb1.Items.text=editcocktail.text) do table1.Next;					
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Di 03.06.03 18:31 
Die Listbox kennt die Eigenschaften ItemIndex und Items. Wenn mich nicht alles täuscht, gibst du z.B. einem Label einen Text aus der Listbox wie folgt:

ausblenden Delphi-Quelltext
1:
Label1.Caption:=ListBox1.Items[ListBox1.ItemIndex];					


Versuch das mal. Das müßte gehen, oder?

_________________
Hasta La Victoria Siempre
qball Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Di 03.06.03 18:39 
Danke für die schnelle Hilfe, das hat funktioniert