public static FrmCalendar GetSingleton() { if (frm == null || frm.IsDisposed) { frm = new FrmCalendar(); } return(frm); }
private void tsmiWorkCalendar_Click(object sender, EventArgs e) { //{ // if (Application.OpenForms["FrmCalendar"] != null) // { // Application.OpenForms["FrmCalendar"].Show(); // } // else // { // FrmCalendar frm = new FrmCalendar(); // frm.MdiParent = this; // frm.Show(); // } //} FrmCalendar frm = FrmCalendar.GetSingleton(); frm.MdiParent = this; frm.Show(); frm.Activate(); }
private void FrmCalendar_FormClosing(object sender, FormClosingEventArgs e) { frm = null; }