473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Adding items to a combo box

TS
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
Dec 7 '05 #1
6 2908
TS wrote:
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
Dec 7 '05 #2
TS
This is the problem, I tried
combobox1.Items.Add("Manhattan", "Queens", "SI", "....", "....") and it
didn't work. Please help!!
--
TS
"I Don't Like Spam" wrote:
TS wrote:
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

Dec 7 '05 #3
TS wrote:
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("...")
Dec 7 '05 #4
"TS" <TS@discussions.microsoft.com> schrieb:
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" _
} _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 7 '05 #5
Or something like this

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

Meelis


"TS" <TS@discussions.microsoft.com> wrote in message
news:EE**********************************@microsof t.com...
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

Dec 8 '05 #6
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
Dec 8 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
4
by: Gav | last post by:
I am using VS 2005 and am trying to add items to a combo box using C#. I know how to add simple text items but I am trying to add a value and some text ie. Value Text A First Text B ...
6
by: vb | last post by:
Hi, I am new to .Net. I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to...
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
1
by: Gian Paolo | last post by:
hi all i'm looking for a way to add 2 items in a combobox in the same line and hide one. i'm working on the code above but it returns me only the last value i entered and i do not know why.... ...
1
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup...
0
by: mollyf | last post by:
I've got a combo box that I want to bind a collection to. I got the error "Complex Data Binding accepts as a data source either an IList or an IListSource" so I tried using the BindingSource,...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
1
by: imwhiteandnerdy | last post by:
i'm hoping I can get some help with adding my combo box selection to my access database.Any Help would be appreciated. I've been told I need complex binding Basically I just want to add the...
3
by: =?Utf-8?B?Y2RtdW5veg==?= | last post by:
I have created a sub routine to programmatically add an indefinite number of combo boxes to a form. The combo boxes are bound in code to a view for displaying the available options. This routine...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.