public void methodon(String t, String parent)
 {
     if (GlobeVal.mysys.language == 0)
     {
         if (t == "打开方法")
         {
             UserControl常规1.Init(0, false);
             panelback.Visible = false;
             panelback.Controls.Clear();
             UserControl常规1.Dock = DockStyle.Fill;
             panelback.Controls.Add(UserControl常规1);
             panelback.Visible = true;
         }
     }
     else
     {
         if (t == "Open Method")
         {
             UserControl常规1.Init(0, false);
             panelback.Visible = false;
             panelback.Controls.Clear();
             UserControl常规1.Dock = DockStyle.Fill;
             panelback.Controls.Add(UserControl常规1);
             panelback.Visible = true;
         }
     }
 }
Beispiel #2
0
        public UserControlMethod()
        {
            InitializeComponent();
            treeView1.mimagelist = imageList2;

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲

            this.tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel1, true, null);
            this.tableLayoutPanel2.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel2, true, null);
            this.tableLayoutPanel3.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel3, true, null);


            UserControl试样1 = new UserControl试样();
            UserControl常规1 = new UserControl常规();
            UserControl控制1 = new UserControl控制();
            UserControl计算1 = new UserControl计算();
            UserControl结果1 = new UserControl结果();

            UserControl控制台1  = new UserControl控制台();
            UserControl额外显示1 = new UserControl额外显示();
            UserControl曲线1   = new UserControl曲线();
            UserControl曲线2   = new UserControl曲线();
            UserControl原始数据1 = new UserControl原始数据();
            UserControl文件设置1 = new UserControl文件设置();
            UserControl缺省表格1 = new UserControl缺省表格();
            UserControl数据库1  = new UserControl数据库();
            UserControl摄像1   = new UserControl摄像();
            UserControl长时数据1 = new UserControl长时数据();

            UserControl试样1.musercontrolmethod = this;
            UserControl常规1.musercontrolmethod = this;
            UserControl控制1.musercontrolmethod = this;
            UserControl计算1.musercontrolmethod = this;
            UserControl结果1.musercontrolmethod = this;

            UserControl控制台1.musercontrolmethod  = this;
            UserControl额外显示1.musercontrolmethod = this;
            UserControl曲线1.musercontrolmethod   = this;
            UserControl曲线2.musercontrolmethod   = this;
            UserControl原始数据1.musercontrolmethod = this;
            UserControl文件设置1.musercontrolmethod = this;
            UserControl缺省表格1.musercontrolmethod = this;
            UserControl数据库1.musercontrolmethod  = this;
            UserControl摄像1.musercontrolmethod   = this;
            UserControl长时数据1.musercontrolmethod = this;

            UserControl常规1.Init(0, false);
            panelback.Visible = false;
            panelback.Controls.Clear();
            UserControl常规1.Dock = DockStyle.Fill;
            panelback.Controls.Add(UserControl常规1);
            panelback.Visible = true;
        }
Beispiel #3
0
 public void methodon(String t, String parent)
 {
     if (t == "打开方法")
     {
         UserControl常规1.Init(0, false);
         panelback.Visible = false;
         panelback.Controls.Clear();
         UserControl常规1.Dock = DockStyle.Fill;
         panelback.Controls.Add(UserControl常规1);
         panelback.Visible = true;
     }
 }
Beispiel #4
0
        private void UserControlMethod_Load(object sender, EventArgs e)
        {
            UserControl常规1 = new UserControl常规();
            UserControl常规1.Init(0, true);

            panelback.Controls.Clear();
            UserControl常规1.Dock   = DockStyle.Fill;
            UserControl常规1.Width  = panelback.Width;
            UserControl常规1.Height = panelback.Height;

            panelback.Controls.Add(UserControl常规1);

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲

            this.tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel1, true, null);
            this.tableLayoutPanel2.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel2, true, null);
            this.tableLayoutPanel3.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this.tableLayoutPanel3, true, null);

            treeView1.SelectedNode = treeView1.Nodes[0];
        }
Beispiel #5
0
        public void methodon(String t, String parent)
        {
            if (t == "方法")
            {
                UserControl常规1.Init(0, false);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl常规1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl常规1);
                panelback.Visible = true;
            }

            if (t == "样品")
            {
                UserControl常规1.Init(1, false);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl常规1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl常规1);
                panelback.Visible = true;
            }

            if (t == "基本布局")
            {
                UserControl常规1.Init(2, false);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl常规1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl常规1);
                panelback.Visible = true;
            }
            if (t == "高级布局")
            {
                UserControl常规1.Init(3, false);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl常规1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl常规1);
                panelback.Visible = true;
            }


            if (t == "尺寸")
            {
                UserControl试样1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl试样1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl试样1);
                panelback.Visible = true;
            }
            if (t == "数字输入")
            {
                UserControl试样1.Init(1);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl试样1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl试样1);
                panelback.Visible = true;
            }

            if (t == "文本输入")
            {
                UserControl试样1.Init(2);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl试样1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl试样1);
                panelback.Visible = true;
            }

            if (t == "选项输入")
            {
                UserControl试样1.Init(3);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl试样1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl试样1);
                panelback.Visible = true;
            }

            if (t == "测试")
            {
                UserControl控制1.Visible = false;

                if (CComLibrary.GlobeVal.filesave.mcontrolprocess == 1)
                {
                    UserControl控制1.Init(8);
                }



                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible      = true;
                UserControl控制1.Visible = true;
            }

            if (t == "测试前")
            {
                UserControl控制1.Init(2);

                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible = true;
            }
            if (t == "测试结束")
            {
                UserControl控制1.Init(4);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible = true;
            }
            if (t == "数据")
            {
                UserControl控制1.Init(5);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible = true;
            }
            if (t == "应变")
            {
                UserControl控制1.Init(1);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible = true;
            }
            if (t == "试验选项")
            {
                UserControl控制1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制1);
                panelback.Visible = true;
            }

            if (t == "设定")
            {
                UserControl计算1.Init();
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl计算1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl计算1);
                panelback.Visible = true;
            }

            if (t == "列")
            {
                if (parent == "结果1")
                {
                    UserControl结果1.resulttab = 0;
                }

                if (parent == "结果2")
                {
                    UserControl结果1.resulttab = 1;
                }
                UserControl结果1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl结果1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl结果1);
                panelback.Visible = true;
            }
            if (t == "统计")
            {
                if (parent == "结果1")
                {
                    UserControl结果1.resulttab = 0;
                }

                if (parent == "结果2")
                {
                    UserControl结果1.resulttab = 1;
                }
                UserControl结果1.Init(1);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl结果1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl结果1);
                panelback.Visible = true;
            }
            if (t == "格式")
            {
                if (parent == "结果1")
                {
                    UserControl结果1.resulttab = 0;
                }

                if (parent == "结果2")
                {
                    UserControl结果1.resulttab = 1;
                }
                UserControl结果1.Init(2);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl结果1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl结果1);
                panelback.Visible = true;
            }



            if (t == "实时显示")
            {
                UserControl控制台1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制台1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制台1);
                panelback.Visible = true;
            }
            if (t == "按键")
            {
                UserControl控制台1.Init(1);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制台1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制台1);
                panelback.Visible = true;
            }
            if (t == "主机")
            {
                UserControl控制台1.Init(2);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl控制台1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl控制台1);
                panelback.Visible = true;
            }

            if (t == "电表设置")
            {
                UserControl额外显示1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl额外显示1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl额外显示1);
                panelback.Visible = true;
            }
            if (t == "操作输入")
            {
                UserControl额外显示1.Init(1);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl额外显示1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl额外显示1);
                panelback.Visible = true;
            }


            if (t == "类型")
            {
                if (parent == "曲线图1")
                {
                    UserControl曲线1.curvetab = 0;
                    UserControl曲线1.Init(0);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线1.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线1);
                    panelback.Visible = true;
                }
                if (parent == "曲线图2")
                {
                    UserControl曲线2.curvetab = 1;
                    UserControl曲线2.Init(0);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线2.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线2);
                    panelback.Visible = true;
                }
            }

            if (t == "X轴数据")
            {
                if (parent == "曲线图1")
                {
                    UserControl曲线1.Init(1);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线1.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线1);
                    panelback.Visible = true;
                }
                if (parent == "曲线图2")
                {
                    UserControl曲线2.Init(1);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线2.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线2);
                    panelback.Visible = true;
                }
            }
            if (t == "Y轴数据")
            {
                if (parent == "曲线图1")
                {
                    UserControl曲线1.Init(2);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线1.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线1);
                    panelback.Visible = true;
                }
                if (parent == "曲线图2")
                {
                    UserControl曲线2.Init(2);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线2.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线2);
                    panelback.Visible = true;
                }
            }

            if (t == "高级")
            {
                if (parent == "曲线图1")
                {
                    UserControl曲线1.Init(3);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线1.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线1);
                    panelback.Visible = true;
                }
                if (parent == "曲线图2")
                {
                    UserControl曲线2.Init(3);
                    panelback.Visible = false;
                    panelback.Controls.Clear();
                    UserControl曲线2.Dock = DockStyle.Fill;
                    panelback.Controls.Add(UserControl曲线2);
                    panelback.Visible = true;
                }
            }
            if (t == "摄像")
            {
                UserControl摄像1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl摄像1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl摄像1);
                panelback.Visible = true;
            }
            if (t == "原始数据输出")
            {
                UserControl原始数据1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl原始数据1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl原始数据1);
                panelback.Visible = true;
            }

            if (t == "数据库设置")
            {
                UserControl数据库1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl数据库1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl数据库1);
                panelback.Visible = true;
            }

            if (t == "峰值趋势数据输出")
            {
                UserControl长时数据1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl长时数据1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl长时数据1);
                panelback.Visible = true;
            }

            if (t == "文档设置")
            {
                UserControl文件设置1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl文件设置1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl文件设置1);
                panelback.Visible = true;
            }

            if (t == "缺省表格")
            {
                UserControl缺省表格1.Init(0);
                panelback.Visible = false;
                panelback.Controls.Clear();
                UserControl缺省表格1.Dock = DockStyle.Fill;
                panelback.Controls.Add(UserControl缺省表格1);
                panelback.Visible = true;
            }
        }