CheckedListBox in Windows Form

X

xiuyu_0129

Hi All,

How do I store a string value for an item in a CheckedListBox in
Windows Form?

For a web based application, CheckBoxList allowed us to store 2 string
values for the item in it. How do I achieve that when making use of the
CheckedListBox in windows form.

Thanks.
 
D

D. Yates

One suggestion is to follow Nicholas Paldino's advice about listboxes from
November 10th......

Wrap your data in an class and then override the class' ToString() method
(public override string ToString()).

Afterwards, instantiate an instance of the class, populate it with data,
insert the instance of the class into the CheckedListBox's Items collection,
and repeat as necessary.

The CheckedListBox will use the ToString() of your new class to determine
what to show on each line.


Have fun!

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top