Page 1 of 1
How to use comboBox
Posted: Sun Apr 29, 2012 4:47 am
by hortencio
I would like to introduce some information in ComboBox in vb C# and when a select any information from the ComboBox such information has to be filled in the respective field.How can I do that?
Re: How to use comboBox
Posted: Sun Apr 29, 2012 10:03 am
by comathi
Using code, you could add items to the ComboBox like so:
Or, you could go to the ComboBox's properties and click on '...' next to the 'Items' property. This will bring up a window where gou can manually enter the items.
As for inputting the ComboBox data into a TextBox, for instance, you can use the following code:
Code: Select allTextBox1.Text=ComboBox1.SelectedItem
This should work, but I'm on a mobile right now so I cannot double-check.
Anyways, hope this helps ;)
Re: How to use comboBox
Posted: Sun Apr 29, 2012 4:04 pm
by MrAksel
Its in the C# section ;)
Code: Select alltextBox1.Text = comboBox1.SelectedItem.ToString()
Re: How to use comboBox
Posted: Sun Apr 29, 2012 6:15 pm
by comathi
MrAksel wrote:Its in the C# section ;)
Code: Select alltextBox1.Text = comboBox1.SelectedItem.ToString()
Oh, I see. Sorry about that. I got confused, as he named both languages in his post :lol:
hortencio wrote:in vb C#