Пример #1
0
        // Sau khi chon project thi bao len laf da chon
        void Init(object sender, EventArgs e)
        {
            //(sender as Project.fOpen).Close();



            if (frmPower != null)
            {
                frmPower.Close();
            }
            if (frmSwitch != null)
            {
                frmSwitch.Close();
            }
            if (frmTai != null)
            {
                frmTai.Close();
            }
            if (fcheck != null)
            {
                fcheck.Close();
            }

            createSwitchForm();
            createLoadForm();
            createPowerForm();
            createCheckForm();

            // newcode start
            frmPower.OffPowerAll();
            frmTai.OffLoad();
            frmSwitch.IsOnPower = true;
            frmSwitch.OnOffPower();
        }
Пример #2
0
        // Sau khi chon project thi bao len laf da chon
        void frm_SelectedProject(object sender, EventArgs e)
        {
            (sender as Project.fOpen).Close();

            EnabledMenu();

            tsmenuItemSystem.Enabled = false;

            if (frmPower != null)
            {
                frmPower.Close();
            }
            if (frmSwitch != null)
            {
                frmSwitch.Close();
            }
            if (frmTai != null)
            {
                frmTai.Close();
            }
            if (fcheck != null)
            {
                fcheck.Close();
            }

            //MessageBox.Show("Đã chọn dự án");

            frmPower  = new fPower1();
            frmSwitch = new fSwitchForm();
            frmTai    = new fLoadForm();
            fcheck    = new fCheckForm();

            frmPower.FormClosing  += FrmPower_FormClosing;
            frmSwitch.FormClosing += FrmSwitch_FormClosing;
            frmTai.FormClosing    += FrmTai_FormClosing;
            fcheck.FormClosing    += Fcheck_FormClosing;

            tsmenuItemControlPower.Enabled  = false;
            tsmenuItemControlSwitch.Enabled = false;
            tảiToolStripMenuItem.Enabled    = false;
            tsmenuItemControlCheck.Enabled  = false;

            frmPower.MdiParent  = this;
            frmSwitch.MdiParent = this;
            frmTai.MdiParent    = this;
            fcheck.MdiParent    = this;


            frmPower.Show();
            frmPower.Location = new Point(0, 0);

            frmSwitch.Show();
            frmSwitch.Location = new Point(929, 0);

            frmTai.Show();
            frmTai.Location = new Point(1247, 0);


            fcheck.Show();
            fcheck.Location = new Point(100, 100);

            fcheck.StartAll += fcheck_StartAll;
            fcheck.StopAll  += fcheck_StopAll;
        }