Exemple #1
0
        private void btnTerminalTemp_Click(object sender, EventArgs e)
        {
            Form fo = FindMdiChildren("TerminalTemperaturex");

            if (fo != null)
            {
                fo.Show();
            }
            else
            {
                fo           = new TerminalTemperaturex();
                fo.MdiParent = this;
                fo.Show();
            }
            fo.Activate();
        }
Exemple #2
0
        private void MDIParent1_Load(object sender, EventArgs e)
        {
            tcputil.InitalSevice(); //注册tcp连接

            Form fo2 = FindMdiChildren("TerminalTemperaturex");

            if (fo2 != null)
            {
                fo2.Show();
            }
            else
            {
                fo2           = new TerminalTemperaturex();
                fo2.MdiParent = this;
                fo2.Show();
            }
            fo2.Activate();

            Form fo = FindMdiChildren("Main");

            if (fo != null)
            {
                fo.Show();
            }
            else
            {
                fo           = new Main();
                fo.MdiParent = this;
                fo.Show();
            }
            fo.Activate();

            this.FormClosed += new FormClosedEventHandler(MDIParent1_FormClosed);

            System.Timers.Timer t = new System.Timers.Timer();
            t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
            t.Interval = 1000 * Convert.ToInt16(2);
            t.Enabled  = true;
        }