Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I happen to have a checkedlistbox that contains different high school subjects. What i want is the checked items to be displayed in difèrent textboxes. E.g if math and science are checked let their string values be shown in textbox 1 and 2 respectively.
Posted
Updated 26-May-16 2:39am
Comments
Sergey Alexandrovich Kryukov 22-Jun-11 13:00pm    
Tag it! WPF, ASP.NET, Forms, what?!
--SA
capdevillia 23-Jun-11 7:19am    
Forms
Sergey Alexandrovich Kryukov 24-Jun-11 19:09pm    
No! It will become "Forms" when you put a tag. Use "Improve question".
--SA

Iterate through the CheckedItems collection for Windows or the Items collection in Web, compare values and populate textboxes appropriately.
 
Share this answer
 
VB
Dim i As Integer = 0
       ' Loop through all the selected items of the listbox and append them to the textbox text property
       For i = 0 To CheckedListBox1.CheckedItems.Count - 1
           TextBox1.Text += CheckedListBox1.CheckedItems.Item(i).ToString() & ","
       Next

Hope this will you and others!

Regards
Abkasoft
 
Share this answer
 
Comments
arulrajhan 8-Mar-15 7:56am    
dear sir i want checked items in checkedlistbox and displaying them in datagridview
please send to my mail
arspromr@gmail.com

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