Beispiel #1
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 #2
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];
        }