Click here to Skip to main content
15,860,859 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Help me pls
How can I declare Combobox1...because it shows an error that: "Combobox1 is not declared.."


how can I declare it?


that's the code:

VB
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load



        ComboBox1.Items.Add("4")
        ComboBox1.Items.Add("5")
        ComboBox1.Items.Add("6")
        ComboBox1.Items.Add("7")
        ComboBox1.Items.Add("8")
        ComboBox1.Items.Add("9")
        ComboBox1.Items.Add("10")
        ComoBox1.SelectedItem = 0


VB
End Sub
Posted

Dim ComboBox1 as new ComboBox().

Also, your last line of code in your thread is spelled wrong.
 
Share this answer
 
v2
Comments
San Dra 17-Jan-13 16:40pm    
combobox.SelectedItem = 0

It was because I typed faster on keyboard sorry about that.
Richard C Bishop 17-Jan-13 16:42pm    
No worries, I just wasn't sure if that was in your code too. Did my suggestion work for you?
Sergey Alexandrovich Kryukov 17-Jan-13 16:55pm    
No, you need to copy everything from real code. Why feeding more of the garbage to this site? we have enough already. :-)
—SA
Espen Harlinn 17-Jan-13 16:50pm    
5'ed!
Sergey Alexandrovich Kryukov 17-Jan-13 16:55pm    
Sure, a 5.
—SA
Add a combo box to your form and name it ComboBox1
 
Share this answer
 
Comments
Espen Harlinn 17-Jan-13 16:51pm    
5'ed! Nice and simple :-D
San Dra 18-Jan-13 6:12am    
Ok that's okey, but when i want to Display it: it shows the message: " generate combobox1.text..." and some other message that contain an error :/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900