473,396 Members | 2,036 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.

ToolStripComboBox Items

How can I add an item to a ToolStripComboBox and specify a DisplayMember and
a ValueMember?
Nov 21 '05 #1
5 11440
vb
dim li as new listitem
li.text = ""
li.value = ""
item.add(li)

Working on C#
Think it is
listitem li = new listitem;
li.text="";
li.value="";
item.add[li];

"Manuel" <No****@NoMailLand.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
How can I add an item to a ToolStripComboBox and specify a DisplayMember
and a ValueMember?

Nov 21 '05 #2
Umm I am sorry if this is not the proper code.. I see not that your stating
TOOLStrip. If you mean the Toolbar, this code is incorrect below.
I do not know hot to intergrate in to VS, I have never needed to.

"Chris" <cc*********@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP11.phx.gbl...
vb
dim li as new listitem
li.text = ""
li.value = ""
item.add(li)

Working on C#
Think it is
listitem li = new listitem;
li.text="";
li.value="";
item.add[li];

"Manuel" <No****@NoMailLand.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
How can I add an item to a ToolStripComboBox and specify a DisplayMember
and a ValueMember?


Nov 21 '05 #3
this link might helps you
http://www.devx.com/dotnet/Article/22001/0/page/3

Net
"Chris" <cc*********@hotmail.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
Umm I am sorry if this is not the proper code.. I see not that your
stating TOOLStrip. If you mean the Toolbar, this code is incorrect below.
I do not know hot to intergrate in to VS, I have never needed to.

"Chris" <cc*********@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP11.phx.gbl...
vb
dim li as new listitem
li.text = ""
li.value = ""
item.add(li)

Working on C#
Think it is
listitem li = new listitem;
li.text="";
li.value="";
item.add[li];

"Manuel" <No****@NoMailLand.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
How can I add an item to a ToolStripComboBox and specify a DisplayMember
and a ValueMember?



Nov 21 '05 #4
That example does not specify a DisplayMember and a ValueMember, it just
fills the list with Strings:
----------------------------
foreach (DataRow record in subDeptTable.Rows)
{
cboSubDept.ComboBox.Items.Add(
record["SubDepartmentName"].ToString());
}
----------------------------
"Net Dev" <ne********@yahoo.com.au> wrote in message
news:df**********@nnrp.waia.asn.au...
this link might helps you
http://www.devx.com/dotnet/Article/22001/0/page/3

Net
"Chris" <cc*********@hotmail.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
Umm I am sorry if this is not the proper code.. I see not that your
stating TOOLStrip. If you mean the Toolbar, this code is incorrect below.
I do not know hot to intergrate in to VS, I have never needed to.

"Chris" <cc*********@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP11.phx.gbl...
vb
dim li as new listitem
li.text = ""
li.value = ""
item.add(li)

Working on C#
Think it is
listitem li = new listitem;
li.text="";
li.value="";
item.add[li];

"Manuel" <No****@NoMailLand.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
How can I add an item to a ToolStripComboBox and specify a
DisplayMember and a ValueMember?



Nov 21 '05 #5
I searched for ListItem on the Object Browser and it only appears as part of
the System.Web.UI.WebControls namespace (and I'm not working on a web
application).

What namespace are you using?

"Chris" <cc*********@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP11.phx.gbl...
vb
dim li as new listitem
li.text = ""
li.value = ""
item.add(li)

Working on C#
Think it is
listitem li = new listitem;
li.text="";
li.value="";
item.add[li];

"Manuel" <No****@NoMailLand.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
How can I add an item to a ToolStripComboBox and specify a DisplayMember
and a ValueMember?


Nov 21 '05 #6

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

Similar topics

12
by: Donnal Walter | last post by:
The following method is defined in one of my classes: def setup(self, items={}): """perform setup based on a dictionary of items""" if 'something' in items: value = items # now do something...
0
by: Job Lot | last post by:
How can i bind ToolStripComboBox to a DataTable? There is no DataSource, DisplayMember & ValueMemeber property? Thanks
3
by: bds | last post by:
Is there any way to databind a ToolStripComboBox? I have a form where I'd like a databound combobox to be the parameter selection of a DataGridView. This combobox comes from a table with your...
4
by: mb | last post by:
what is the best way to do this: In a game I want to a class called "Items". This class will have the game items public class Items { public int Chair public int Table . . .and so on . . .
2
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
1
by: Jim Hubbard | last post by:
Why isn't the Keypress event of the System.Windows.Form.ToolStripComboBox triggered by hitting the Enter key? I cannot trap Keys.Enter or Keys.Return in the Keypress event.
2
by: Jason Richmeier | last post by:
Perhaps it is because it is the end of the day and my eyes are tired of looking at code but I cannot seem to figure out what I am doing wrong and what I can do (if anything) to fix it. On a...
0
by: McPolu | last post by:
Hello. I am trying to set ToolStripComboBox.DroppedDown inside of the Leave event and it does not work: public class MyToolStripComboBox : ToolStripComboBox { public MyToolStripComboBox() {...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.