Checkbox list questions

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am new to vs2005 and have two questions re: chekbox list.

1. How can I check in code what item was clicked?

2. How can I access an item's value in code?

Thanks

Regards
 
1. ItemCheck event is fired whenever an item is checked/unchecked. The event
arguments carry information regarding the index of the checked item and the
new value and old state

2. As for the items in the list box there are several properties that can be
used:
- Items - collection of items that can be accessed by index
- SelectedIndex / SelectedIndices - gets the index of the selected element
or elements in case of multiselection. This index can be used with the Items
collection to get the selected tem
- SelectedItem / SelectedItems - gets the selected item (no need of using
the Items collection)
- There aslo collections regarding checked elements only: CheckedIndex(ces)
and CheckedItem(s).
 
Back
Top