VB.NET 1.1 - Listbox vs. CheckedListBox question

  • Thread starter Thread starter bh
  • Start date Start date
B

bh

In the Listbox, there are properties for DisplayMember and ValueMember, just
like the combobox, however, those properties are not present for the
CheckedListBox.

Does this mean that the only value you can actually reference in a
CheckedListBox is what is actually dispalyed in the item? Is there a way to
list several states (Alabama, Florida, California...) and retreive the
value, somehow (AL, FL, CA...) for database lookup, using a CheckedListBox?

Thanks in advance.

bh
 
Hello bh,

To read the value for a specific item in the list, you can use:
myCheckBoxList.Item(index).Value

The property for setting which field is used as the value is "DataValueField".

Hope that helps.
Regards,
Dannielle
 
This does not work in .Net 2.
How would you refer to the value as there is no Value property?
 
Back
Top