Click here to Skip to main content
15,884,794 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do i get checked items in checklistbox and display it in label box.
and put comma after each other

ex:

[] Action
[x] Drama
[x] Horror
[] Sci-fi
[x] Thriller

label = Drama, Horro, Thriller
Posted

1 solution

You can get the checked items with the CheckedListBox.CheckedItems[^]-Property. The linked page has an example at the bottom. Then join these strings, for example, with String.Join(..)[^] (also has an example at the bottom) specifying ", " for the separator and assign the result string to the Label.Text[^]-Property of your label.
 
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