示例#1
0
        /// <summary>
        /// 打开/关闭运动控制面板
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpenMove_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.btnOpenMove.Text == "打开控制面板")
                {
                    this.btnOpenMove.Text = "关闭控制面板";

                    if (this.formMove == null)
                    {
                        this.formMove = new FormMove();
                        this.formMove.BringToFront();
                        this.formMove.CloseEvent += FormMove_MyClose;
                        this.formMove.Show();
                    }
                    else
                    {
                        this.formMove.Show();
                        this.formMove.BringToFront();
                    }
                }
                else
                {
                    this.btnOpenMove.Text = "打开控制面板";
                    this.formMove.Close();
                    this.formMove = null;
                }
            }
            catch (Exception ex)
            {
                Log.WriterExceptionLog(ex.ToString());
            }
        }
示例#2
0
 /// <summary>
 /// 控制面板关闭事件
 /// </summary>
 private void FormMove_MyClose()
 {
     this.btnOpenMove.Text = "打开控制面板";
     this.formMove.Close();
     this.formMove = null;
 }