Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to Add selected data from a List box to another list box in double clik or with a add button
Posted
Updated 7-Jun-11 19:55pm
v3
Comments
Sergey Alexandrovich Kryukov 8-Jun-11 1:48am    
Not a question. What's your problem?
--SA
beginner in C#.net 8-Jun-11 2:12am    
done any code...
Ragi Gopi 8-Jun-11 2:20am    
iam trying this ..
http://www.codeproject.com/KB/aspnet/List_Box_Control.aspx
Sunasara Imdadhusen 8-Jun-11 2:25am    
You should start something...

1 solution

Unfortunately, ListBox.SelectedItems does not return anything that can be fed directly into ListBox.AddRange, so you have to loop:
foreach (object o in listBox1.SelectedItems)
    {
    listBox2.Items.Add(o);
    }
 
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