Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public CCommPortTypeForm(CCOMM_TYPE ccommType, bool isLockFrame = false)
 {
     this.defaulCCommType = ccommType;
     InitializeComponent();
     base.mLockFrame = isLockFrame;
     this.Startup();
 }
Exemplo n.º 2
0
        /// <summary>
        /// CheckedListBox_SelectedIndexChanged变化事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CheckedListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //---检验当前任务空闲
            if ((sender == null))
            {
                return;
            }
            CheckedListBox clb   = (CheckedListBox)sender;
            int            index = clb.SelectedIndex;

            for (int i = 0; i < clb.Items.Count; i++)
            {
                if (index != i)
                {
                    clb.SetItemCheckState(i, CheckState.Unchecked);
                }
                else
                {
                    clb.SetItemCheckState(i, CheckState.Checked);
                    if (clb.Items[i].ToString() == "串口通讯")
                    {
                        this.defaulCCommType = CCOMM_TYPE.COMM_SERIAL;
                    }
                    else if (clb.Items[i].ToString() == "USB通讯")
                    {
                        this.defaulCCommType = CCOMM_TYPE.COMM_USB;
                    }
                }
            }
            //---这里是为防止双击操作,如果没有,快速双击会导致状态解析错误
            CGenFuncDelay.GenFuncDelayms(150);
        }