![]() |
Combobox + AddItem
Hi Leute,
habe eine Frage zu Comboboxen an euch: Ich würde gerne mit AddItem einen String und eine Zahl hinzufügen (quasi den Wert und die ID dazu). cmb_schularten.AddItem('test',23); Allerdings will addItem als 2. Parameter ja ein tObject - wie kann ich einen Int als Object parsen und umgekehrt? Oder sollte man das eh anders machen? Vielen Dank schonmal, greets ben |
Re: Combobox + AddItem
Guck dir das mal an:
![]() |
Re: Combobox + AddItem
Hai bwolf;
setzen:
Delphi-Quellcode:
auslesen:
var
mystring : string; zahl : integer; begin mystring := 'blubb'; zahl := 10; ComboBox1.AddItem(mystring,TObject(zahl));
Delphi-Quellcode:
var
mystring : string; zahl : integer; begin mystring := ComboBox1.Items[ComboBox1.ItemIndex]; zahl := Integer(ComboBox1.Items.Objects[ComboBox1.ItemIndex]); |
Re: Combobox + AddItem
10000 Dank für diese schnellen und hilfreichen Antworten :thumb:
grüße, ben |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:41 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 by Thomas Breitkreuz