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);
 
           }
 
      }
}
//判断第i项是否选中,选中为true,否则为false
ifCheckedlistbox.GetItemChecked(i)) 
{
return true;
}
else
{
return false;
}
//true改为false为没有选中。
Checkedlistbox.SetItemChecked(i, true);
原文地址:https://www.cnblogs.com/yc1224/p/11940577.html