/// <summary> /// Opens the tape database form and/or click the add new button /// </summary> private void OpenTapeToAdd() { //close child of mdi if there is one active if (ActiveMdiChild != null) { if (ActiveMdiChild is TapeListForm) { //click on the add button TapeListForm form = (TapeListForm)ActiveMdiChild; Button button = form.Controls.Find("tapeListAddNewButton", true).FirstOrDefault() as Button; if(button != null) { button.PerformClick(); } } else { //Close child ActiveMdiChild.Close(); //Show search tape database form and maximize it instantly //create new instance of form SearchTapeForm tapeListForm = new TNG_Database.TapeListForm(this, true); tapeListForm.Show(); tapeListForm.WindowState = FormWindowState.Maximized; } } ResetProgressBar(); }
/// <summary> /// Opens the tape datebase page. /// </summary> private void OpenTapeDatebasePage() { //create new instance of form SearchTapeForm tapeListForm = new TNG_Database.TapeListForm(this); //close child of mdi if there is one active if (ActiveMdiChild != null) { if(ActiveMdiChild is TapeListForm) { //Do nothing }else { //Close child ActiveMdiChild.Close(); } } //Show search tape database form and maximize it instantly tapeListForm.Show(); tapeListForm.WindowState = FormWindowState.Maximized; ResetProgressBar(); }