Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Add Items in Combobox from listbox
Note : Combobox & Listbox in Winform main

Combo box items does not display below of combobox, why?

[EDIT] Title spell corrected [/EDIT]
Posted
Updated 12-Jan-11 9:16am
v2

Add items to the Items property

ComboBox.Items Property[^]

Regards
Espen Harlinn
 
Share this answer
 
v2
What you have tried to add items in Combobox. show your code to find out why Combobox items doesn't display.

whatever, you can use given code
C#
foreach (object obj in listBox1.Items)
           {
               comboBox1.Items.Add(obj);
           }
 
Share this answer
 
Have you set Displaymember & Valuemember properties of combobox ?

comboBox1.DisplayMember = "Name"; 
comboBox1.ValueMember = "Name";
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900