for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
checkedListBox1.Items.Clear();
}
12.
//设置索引为index的项为选中状态
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
checkedListBox1.SetItemChecked(i, true);
}
13.
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
if (checkedListBox1.GetSelected(i))
{
MessageBox.Show(checkedListBox1.CheckedItems.ToString());
}
}
14.
//选中checkedListBox1所有的选项
for (int i = 0; i < checkedListBox1.Items.Count; i++)
{
checkedListBox1.SetItemCheckState(i, CheckState.Checked);
}