private void chkControl_ItemChecking(object sender, DevExpress.XtraEditors.Controls.ItemCheckingEventArgs e)
        {
            SingleSelectCheckedListBoxControls(chkControl, e.Index);
        }


        /// <summary>
        /// 把CheckedListBoxControl设置为单选框
      /// </summary>
        /// <param name="chkControl">CheckedListBoxControl</param>
        /// <param name="index">index当前选中的索引</param>
        public void SingleSelectCheckedListBoxControls(CheckedListBoxControl chkControl, int index)
        {
            if (chkControl.CheckedItems.Count > 0)
            {
                for (int i = 0; i < chkControl.Items.Count; i++)
                {
                    if (i != index)
                    {
                        chkControl.SetItemCheckState(i, System.Windows.Forms.CheckState.Unchecked);
                    }
                }
            }
        }

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-06-16
  • 2022-12-23
  • 2021-05-12
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案