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
 
<pre>
    ComboBox1.Items.Add(&quot;4&quot;)
    ComboBox1.Items.Add(&quot;5&quot;)
    ComboBox1.Items.Add(&quot;6&quot;)
    ComboBox1.Items.Add(&quot;7&quot;)
    ComboBox1.Items.Add(&quot;8&quot;)
    ComboBox1.Items.Add(&quot;9&quot;)
    ComboBox1.Items.Add(&quot;10&quot;)
    ComoBox1.SelectedItem = 0</pre>
 
End Sub
Posted 17-Jan-13 11: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 490
1 Sergey Alexandrovich Kryukov 335
2 ProgramFOX 265
3 Maciej Los 245
4 Andreas Gieriet 200
0 OriginalGriff 465
1 Sergey Alexandrovich Kryukov 275
2 ProgramFOX 265
3 Maciej Los 245
4 Andreas Gieriet 200


Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2015
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