Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB VisualStudio2012
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:
 
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
 
End Sub
Posted 17-Jan-13 10:17am
San Dra391
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Dim ComboBox1 as new ComboBox().

Also, your last line of code in your thread is spelled wrong.
  Permalink  
v2
Comments
San Dra at 17-Jan-13 16:40pm
   
combobox.SelectedItem = 0
 
It was because I typed faster on keyboard sorry about that.
richcb at 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 at 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 at 17-Jan-13 16:50pm
   
5'ed!
Sergey Alexandrovich Kryukov at 17-Jan-13 16:55pm
   
Sure, a 5.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Add a combo box to your form and name it ComboBox1
  Permalink  
Comments
Espen Harlinn at 17-Jan-13 16:51pm
   
5'ed! Nice and simple :-D
San Dra at 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)

  Print Answers RSS
0 OriginalGriff 225
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ChauhanAjay 80
4 ProgramFOX 80
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100