g46905
asked on
listing multiple items in the combobox
I am new to VB.NET and was wondeering if some one could help me with the issue I have uisng windows application.My appliation has combobox.When the user uses the drop down from the combobox,it should list the items.
for example:
when the user clicks the arrow on the combobox, he should have,
car
flight
ship
bike
Can you please help me?
Thanks
for example:
when the user clicks the arrow on the combobox, he should have,
car
flight
ship
bike
Can you please help me?
Thanks
ASKER
where can I add this code?
Thanks
Thanks
the form load event is a good place probably
ASKER
If I want "car" to be a default, what am I supposed to do ?
Please suggest.
Thanks
Please suggest.
Thanks
you can either set the .Text property of the combo box to "Car"
ComboBox1.Text = "Car"
or set the SelectedIndex to the correct item (index starts at 0... which is the 1st item)
ComboBox1.SelectedIndex = 0
ComboBox1.Text = "Car"
or set the SelectedIndex to the correct item (index starts at 0... which is the 1st item)
ComboBox1.SelectedIndex = 0
ASKER
When I placed the above statement in formload method, I got an error.Can you tell me where I can place this statement?
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ComboBox1.Items.Add("fligh
ComboBox1.Items.Add("ship"
ComboBox1.Items.Add("bike"
or
Dim items(3) As String
items(0) = "car"
items(1) = "flight"
items(2) = "ship"
items(3) = "bike"
ComboBox1.Items.AddRange(i