其他分享
首页 > 其他分享> > Checkedlistbox只能单选不能多选

Checkedlistbox只能单选不能多选

作者:互联网

private void Checkedlistbox_ItemCheck(object sender, ItemCheckEventArgs e)
{
      for (int i = 0; i < chkCountry.Items.Count; i++)
      {
           if (i != e.Index)//除去当前选中项其余都处于未选中状态
             {
              Checkedlistbox.SetItemCheckState(i, System.Windows.Forms.CheckState.Unchecked);
 
           }
 
      }
}

 

标签:Index,多选,SetItemCheckState,int,选中,Checkedlistbox,单选
来源: https://www.cnblogs.com/yc1224/p/11940577.html