Tuesday, March 9, 2010

C# - Example to use CheckListBox in a Windows Form

Below is some example to use a CheckListBox:

1) Clear content
ChkBoxList_TID.Items.Clear();

2) Add CheckBox
ChkBoxList_TID.Items.Add("ChkBox Text1");

3) Deteremine # of elements and its status
iTotal = ChkBoxList_TID.Items.Count;
int iIndex = ChkBoxList_TID.SelectedIndex;
ChkBoxList_TID.SelectedItem.ToString()

No comments: