Adding items to a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add 5 items (Manhattan, Queens, SI, Brooklyn, Bronx) to a combo box
when the form loads. How to do this? It should be simple, but .....
 
TS said:
I need to add 5 items (Manhattan, Queens, SI, Brooklyn, Bronx) to a combo box
when the form loads. How to do this? It should be simple, but .....

Public Sub Form_Load(...) Handles Form.Load
Combobox.Items.Add(...)
End Sub
 
This is the problem, I tried
combobox1.Items.Add("Manhattan", "Queens", "SI", "....", "....") and it
didn't work. Please help!!
 
TS said:
This is the problem, I tried
combobox1.Items.Add("Manhattan", "Queens", "SI", "....", "....") and it
didn't work. Please help!!

combobox1.Items.Add("Manhattan")
combobox1.Items.Add("Queens")
combobox1.Items.Add("...")
 
TS said:
I need to add 5 items (Manhattan, Queens, SI, Brooklyn, Bronx) to a combo
box
when the form loads. How to do this? It should be simple, but .....


\\\
Me.ComboBox1.Items.AddRange( _
New String() { _
"Manhattan", "Queens", "SI" _
} _
)
///
 
Or something like this

Dim sArray() as String ={"Manhattan","Queens", "SI", "Brooklyn", "Bronx"}
ComboBox1.Items.AddRange(sArray)



Meelis
 
TS,

If you want to do these things, than use the designer and look in the
designer part how it is done.

Mostly that is done very good accoording to controls.

I thought that you will see in this case than the solution that Herfried
shows you.
(Before somebody thinks it, I am sure that he did not do that for this
answer).

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top