Exemplo n.º 1
0
        private void iOToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DIOBase.GetInstanceInterface() == null)
            {
                MessageBox.Show("IO가 존재하지 않습니다.");
                return;
            }

            if (m_ioCtrlAjin == null)
            {
                m_ioCtrlAjin = new IOControl();
            }

            m_ioCtrlAjin.Show();
            m_ioCtrlAjin.Focus();

            m_ioCtrlAjin.Location = new Point(this.Location.X - m_ioCtrlAjin.Size.Width, this.Location.Y);
        }
Exemplo n.º 2
0
        private void toolStripButton_Click(object sender, EventArgs e)
        {
            ToolStripButton toolbtn = sender as ToolStripButton;

            if (toolbtn.Tag != null)
            {
                switch (toolbtn.Tag.ToString())
                {
                case "主页":
                    skinTabControl1.SelectedTab = 主页Tag;
                    break;

                case "用户管理":
                    skinTabControl1.SelectedTab = 用户管理Tag;
                    userInfo.TopLevel           = false;                //将子窗体设置成非最高层,非顶级控件
                    userInfo.FormBorderStyle    = FormBorderStyle.None; //去掉窗体边框
                    userInfo.Size   = this.panel11.Size;
                    userInfo.Parent = this.panel11;                     //指定子窗体显示的容器
                    userInfo.Dock   = DockStyle.Fill;
                    userInfo.Show();
                    userInfo.Activate();
                    break;

                case "电机":
                    skinTabControl1.SelectedTab = 电机参数Tag;
                    Frm_Machine.TopLevel        = false;                //将子窗体设置成非最高层,非顶级控件
                    Frm_Machine.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
                    Frm_Machine.Size            = this.panel9.Size;
                    Frm_Machine.Parent          = this.panel9;          //指定子窗体显示的容器
                    Frm_Machine.Dock            = DockStyle.Fill;
                    Frm_Machine.Show();
                    Frm_Machine.Activate();
                    break;

                case "IO":
                    skinTabControl1.SelectedTab = IO控制Tag;
                    if (IOControl == null || IOControl.IsDisposed || IOControl.Disposing)
                    {
                        IOControl = new InputOutput(DeviceRsDef.MotionCard, "INPUTDEFINE.csv", "OUTPUTDEFINE.csv");
                    }
                    IOControl.TopLevel        = false;                //将子窗体设置成非最高层,非顶级控件
                    IOControl.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
                    IOControl.Size            = this.panel3.Size;
                    IOControl.Parent          = this.panel3;          //指定子窗体显示的容器
                    IOControl.Dock            = DockStyle.Fill;
                    IOControl.Show();
                    IOControl.Activate();
                    break;

                case "日志":
                    skinTabControl1.SelectedTab = 日志Tag;
                    frmLog.TopLevel             = false;                //将子窗体设置成非最高层,非顶级控件
                    frmLog.FormBorderStyle      = FormBorderStyle.None; //去掉窗体边框
                    frmLog.Size   = this.panel6.Size;
                    frmLog.Parent = this.panel6;                        //指定子窗体显示的容器
                    frmLog.Dock   = DockStyle.Fill;
                    frmLog.Loadshow();
                    frmLog.Show();
                    frmLog.Activate();
                    break;

                case "退出":
                    if (MessageBox.Show("是否退出软件", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK)
                    {
                        //ConfigSpace.ConfigHandle.Instance.Save();
                        Application.Exit();
                    }
                    else
                    {
                        return;
                    }
                    break;

                default:
                    break;
                }
            }
        }