예제 #1
0
        private void AxisPara_Load(object sender, EventArgs e)
        {
            Frm_MotorParam IOControl = new Frm_MotorParam();

            IOControl.TopLevel        = false;
            IOControl.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
            IOControl.Size            = panelforAxisPara.Size;
            IOControl.Parent          = panelforAxisPara;     //指定子窗体显示的容器
            IOControl.Dock            = DockStyle.Fill;
            IOControl.Show();
        }
예제 #2
0
        /// <summary>
        /// 界面切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void toolStripButton1_Click(object sender, EventArgs e)
        {
            ToolStripButton btn = (ToolStripButton)sender;

            switch (btn.Tag.ToInt32())
            {
            case 1:
                tabControl1.SelectedIndex = 0;
                break;

            case 2:
                tabControl1.SelectedIndex   = 1;
                Frm_Machine.TopLevel        = false;                //将子窗体设置成非最高层,非顶级控件
                Frm_Machine.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
                Frm_Machine.Size            = this.panel12.Size;
                Frm_Machine.Parent          = this.panel12;         //指定子窗体显示的容器
                Frm_Machine.Dock            = DockStyle.Fill;
                Frm_Machine.Show();
                Frm_Machine.Activate();
                break;

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

            case 6:
                tabControl1.SelectedIndex   = 5;
                frm_Machine.TopLevel        = false;                //将子窗体设置成非最高层,非顶级控件
                frm_Machine.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
                frm_Machine.Size            = this.panel15.Size;
                frm_Machine.Parent          = this.panel15;         //指定子窗体显示的容器
                frm_Machine.Dock            = DockStyle.Fill;
                frm_Machine.Show();
                frm_Machine.Activate();
                break;

            case 7:

                tabControl1.SelectedIndex = 6;
                clean.TopLevel            = false;                //将子窗体设置成非最高层,非顶级控件
                clean.FormBorderStyle     = FormBorderStyle.None; //去掉窗体边框
                clean.Size   = this.panel17.Size;
                clean.Parent = this.panel17;                      //指定子窗体显示的容器
                clean.Dock   = DockStyle.Fill;
                clean.Show();
                clean.Activate();
                break;

            case 8:

                tabControl1.SelectedIndex  = 7;
                posmachine.TopLevel        = false;                //将子窗体设置成非最高层,非顶级控件
                posmachine.FormBorderStyle = FormBorderStyle.None; //去掉窗体边框
                posmachine.Size            = this.panel18.Size;
                posmachine.Parent          = this.panel18;         //指定子窗体显示的容器
                posmachine.Dock            = DockStyle.Fill;
                posmachine.Show();
                posmachine.Activate();
                break;

            case 9:

                tabControl1.SelectedIndex = 8;
                point.TopLevel            = false;                //将子窗体设置成非最高层,非顶级控件
                point.FormBorderStyle     = FormBorderStyle.None; //去掉窗体边框
                point.Size   = this.panel19.Size;
                point.Parent = this.panel19;                      //指定子窗体显示的容器
                point.Dock   = DockStyle.Fill;
                point.Show();
                point.Activate();
                point.Point_Load();
                break;
            }
        }