/// <summary> /// Opens the master list archive page. /// </summary> private void OpenMasterListArchivePage() { //Create new instance of form MasterListForm masterListForm = new TNG_Database.MasterListForm(this); //close chold of mdi if there is one active if (ActiveMdiChild != null) { if(ActiveMdiChild is MasterListForm) { //Do Nothing }else { //Close child ActiveMdiChild.Close(); } } //show Master list form and maximize it instantly masterListForm.Show(); masterListForm.WindowState = FormWindowState.Maximized; ResetProgressBar(); }
private void OpenMasterArchiveToAdd() { //close chold of mdi if there is one active if (ActiveMdiChild != null) { if (ActiveMdiChild is MasterListForm) { //click on the add button MasterListForm form = (MasterListForm)ActiveMdiChild; Button button = form.Controls.Find("masterListAddButton", true).FirstOrDefault() as Button; if (button != null) { button.PerformClick(); } } else { //Close child ActiveMdiChild.Close(); //Create new instance of form MasterListForm masterListForm = new TNG_Database.MasterListForm(this, true); //show Master list form and maximize it instantly masterListForm.Show(); masterListForm.WindowState = FormWindowState.Maximized; } } ResetProgressBar(); }