private void ShowMainForm() { if (TimesheetForm == null) { TimesheetForm = new frmMain(TimeCard); TimesheetForm.Closed += MainForm_Closed; // avoid reshowing a disposed form TimesheetForm.Show(); } else { TimesheetForm.Activate(); } }
private void MainForm_Closed(object sender, EventArgs e) { TimesheetForm = null; }
private void ShowEditProjectForm() { if (EditProjectForm == null) { EditProjectForm = new frmMain(TimeCard); EditProjectForm.Closed += MainForm_Closed; // avoid reshowing a disposed form EditProjectForm.Show(); } else { EditProjectForm.Activate(); } }
private void EditProjectForm_Closed(object sender, EventArgs e) { TimesheetForm = null; }