Click here to Skip to main content
15,891,936 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have list of course in the listbox.

i have one button called Add Course

Then i have one dropdownlist.

which course i select in the listbox, then i click the Add course, that selected course to be added in the dropdownlist.


for that how can i do using csharp.


Rgds,
Narasiman P
Posted
Comments
[no name] 26-Jul-13 21:47pm    
www.whathaveyoutried.com
Jameel VM 27-Jul-13 1:49am    
why you are wasting your valuable time? ask to Google. he will help you.

C#
private void addcourse_Click(object sender, EventArgs e)
       {
string text = listBox1.GetItemText(listBox1.SelectedItem);
dropdownid.Items.Add(text);
}
 
Share this answer
 
I'm sorry to say but for me this is just to basic not to know.

But here this should be what you want.

C#
private void button1_Click(object sender, EventArgs e)
       {
           listBox1.Items.Add(comboBox1.SelectedItem.ToString());
       }
 
Share this answer
 

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