private void btnNotes_Click(object sender, EventArgs e) { if (ParentForm != null) foreach (Form childForm in ParentForm.MdiChildren) { if (childForm is frmNotes) { if ((string)childForm.Tag == TournamentName) { childForm.WindowState = FormWindowState.Normal; childForm.Focus(); return; } } } var notes = new frmNotes(TournamentName) { MdiParent = ParentForm }; notes.Show(); }
private void notesToolStripMenuItem_Click(object sender, EventArgs e) { if (lstEvents.SelectedItems.Count == 0) return; string name = lstEvents.SelectedItems[0].Text; foreach (Form childForm in ParentForm.MdiChildren) { if (childForm is frmNotes) { if ((string)childForm.Tag == name) { childForm.WindowState = FormWindowState.Normal; childForm.Focus(); return; } } } var notes = new frmNotes(name); notes.MdiParent = ParentForm; notes.Show(); }
private void btnOpenNotes_Click(object sender, EventArgs e) { foreach (Form childForm in MdiChildren) { if (childForm is frmNotes) { if ((string) childForm.Tag == "General Notes") { childForm.WindowState = FormWindowState.Normal; childForm.Focus(); return; } } } var notes = new frmNotes(null); notes.MdiParent = this; notes.Show(); }