//#endregion #endregion End Menu project =========================================== // ************************************************************************************* // ************************************************************************************* // ************************************************************************************* #region Another Menu item Control============================================ private void tsmenuItemControlPower_Click(object sender, EventArgs e) { (sender as ToolStripMenuItem).Enabled = false; fPower1 fpower = new fPower1(); frmPower.FormClosing += FrmPower_FormClosing; fpower.MdiParent = this; fpower.Show(); }
private void createPowerForm() { frmPower = new fPower1(); frmPower.FormClosing += FrmPower_FormClosing; frmPower.MdiParent = this; frmPower.LoadData();//todo here frmPower.WindowState = FormWindowState.Normal; frmPower.StartPosition = FormStartPosition.Manual; frmPower.Location = Common.Const.proConf.locationPower; if (frmPower.Location.Y < 0) { frmPower.Location = new Point(50, 50); } frmPower.Show(); }
//#endregion #endregion End Menu project =========================================== // ************************************************************************************* // ************************************************************************************* // ************************************************************************************* #region Another Menu item Control============================================ private void tsmenuItemControlPower_Click(object sender, EventArgs e) { //(sender as ToolStripMenuItem).Enabled = false; Form fc = Application.OpenForms["fPower1"]; if (fc == null) { fPower1 fpower = new fPower1(); frmPower.FormClosing += FrmPower_FormClosing; fpower.MdiParent = this; fpower.Show(); } else { fc.BringToFront(); } }
// 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; }