private void menuItem11_Click(object sender, System.EventArgs e) { bookQuery = new BookQuery(); for (int x = 0; x < this.MdiChildren.Length; x++) { Form tempChild = (Form)this.MdiChildren[x]; tempChild.Close(); } bookQuery.MdiParent = this; bookQuery.WindowState = FormWindowState.Maximized; bookQuery.Show(); }
private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { switch (toolBar1.Buttons.IndexOf(e.Button)) { case 0: Form addUser = new AddUser(); for (int x = 0; x < this.MdiChildren.Length; x++) { Form tempChild = (Form)this.MdiChildren[x]; tempChild.Close(); } addUser.MdiParent = this; addUser.WindowState = FormWindowState.Maximized; addUser.Show(); break; case 1: Form person = new Person(); for (int x = 0; x < this.MdiChildren.Length; x++) { Form tempChild = (Form)this.MdiChildren[x]; tempChild.Close(); } person.MdiParent = this; person.WindowState = FormWindowState.Maximized; person.Show(); break; case 2: Form bookOut = new BookOut(); for (int x = 0; x < this.MdiChildren.Length; x++) { Form tempChild = (Form)this.MdiChildren[x]; tempChild.Close(); } bookOut.MdiParent = this; bookOut.WindowState = FormWindowState.Maximized; bookOut.Show(); break; case 3: Form bookIn = new BookIn(); for (int x = 0; x < this.MdiChildren.Length; x++) { Form tempChild = (Form)this.MdiChildren[x]; tempChild.Close(); } bookIn.MdiParent = this; bookIn.WindowState = FormWindowState.Maximized; bookIn.Show(); break; case 4: Form bookQuery = new BookQuery(); for (int x = 0; x < MdiChildren.Length; x++) { Form tempChild = (Form)MdiChildren[x]; tempChild.Close(); } bookQuery.MdiParent = this; bookQuery.WindowState = FormWindowState.Maximized; bookQuery.Show(); break; case 5: ModifyCode modifyCode = new ModifyCode(); for (int x = 0; x < MdiChildren.Length; x++) { Form tempChild = (Form)MdiChildren[x]; tempChild.Close(); } modifyCode.MdiParent = this; modifyCode.Tag = this.statusBarPanel2.Text.Trim(); modifyCode.label5.Text = this.statusBarPanel6.Text.Trim(); modifyCode.WindowState = FormWindowState.Maximized; modifyCode.Show(); break; } }