Ejemplo n.º 1
0
        private void tsmenuItemControlSwitch_Click(object sender, EventArgs e)
        {
            (sender as ToolStripMenuItem).Enabled = false;
            fSwitchForm fswitch = new fSwitchForm();

            frmSwitch.FormClosing += FrmSwitch_FormClosing;
            fswitch.MdiParent      = this;
            fswitch.Show();
        }
Ejemplo n.º 2
0
 private void createSwitchForm()
 {
     frmSwitch               = new fSwitchForm();
     frmSwitch.FormClosing  += FrmSwitch_FormClosing;
     frmSwitch.MdiParent     = this;
     frmSwitch.WindowState   = FormWindowState.Normal;
     frmSwitch.StartPosition = FormStartPosition.Manual;
     frmSwitch.Location      = Common.Const.proConf.locationSwitch;
     if (frmSwitch.Location.Y < 0)
     {
         frmSwitch.Location = new Point(50, 50);
     }
     frmSwitch.LoadData();//todo here
     frmSwitch.Show();
 }
Ejemplo n.º 3
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;
        }