控件篇:CheckedListBox的全选与反选

  private void cbXmlAll_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i < cblXmlList.Items.Count; i++)
{
cblXmlList.SetItemChecked(i, cbXmlAll.Checked);
}
} private void cbXmlR_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i < cblXmlList.Items.Count; i++)
{
cblXmlList.SetItemChecked(i, !cblXmlList.GetItemChecked(i));
}
}

cbXmlAll是checkbox,全选。cbXmlR是checkbox,反选。

上一篇:js 带遮罩层的弹出层


下一篇:iOS开发——UI基础-控制器,IBAction和IBOutlet,UIView