473,382 Members | 1,464 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,382 software developers and data experts.

Add an item to a ListBox from a ComboBox

Sam
Hi !!

I have a ComboBox and a ListBox on my form. The Combobox is filled at
the form Load.
After selecting an item from the combobox the item should be added to
the listbox with the text and the value.
I am not able to do so. Please will anyone help me out of this.

Sam

Feb 27 '06 #1
2 2110
this.ListBox.Items.Add(new ListItem(ComboBox.SelectedItem))
?

"Sam" <sa*********@gmail.com> wrote in message
news:11**********************@t39g2000cwt.googlegr oups.com...
Hi !!

I have a ComboBox and a ListBox on my form. The Combobox is filled at
the form Load.
After selecting an item from the combobox the item should be added to
the listbox with the text and the value.
I am not able to do so. Please will anyone help me out of this.

Sam

Feb 27 '06 #2
Sam
thanx for the reply.
But i am getting an error "The type or namespace name 'ListItem' could
not be found"

as I am using in WinForm application.

Sam

Feb 27 '06 #3

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

Similar topics

4
by: Filips Benoit | last post by:
Dear All, I have code that selects - find and select - 1 item in a large listbox. This works Ok but most of the time the selected item isn't visible without scrolling down manualy. Is this...
3
by: RC | last post by:
I have a form where the user enters the Model info. The user picks the Model from either a combobox or listbox which both are filled from the Models table. If the Model type isn't in the boxes,...
2
by: Alpha | last post by:
How do I change the selected item in a listbox according to a Combox's selected item on the same form? The Combox is from a different table in the same dataset as the Listbox uses. Combox's...
21
by: Bilal Abbasi | last post by:
I realize that you can add items to a list box as objects so you can have access to more than just one property like the itemindex in vb6. Question I have is how do I cause the listbox to show a...
3
by: Sam | last post by:
Hi, How can I add an item to a listbox so that when we select an item afterward, we'll get the id associate, like the display member and the value member for a combobox ? regards
1
by: Guy Noir | last post by:
OK. I need help. I have a listbox, a combo box and some text fields The list box is populated by a dataSet The comboBox is populated by a dataSet When an entry is selected in the listbox, I...
1
by: lkp_ajay_mehta | last post by:
plz help.i am beginner of ms access.any thing about listbox,combobox which help me to understand how to create listbox,combobox for working sent to me.
5
by: =?Utf-8?B?QmVu?= | last post by:
How would you add an item with its DisplayMember and ValueMember without binding to a datatable or dataview like: listbox.DisplayMember = "name"; listbox.ValueMember = "recid"; listbox.DataSource...
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.