private void viewFormButton_Click(object sender, EventArgs e) { var di = Utilities.OpenDirectory(); if (di != null) { ViewForm viewForm = new ViewForm(di); viewForm.FormClosed += (s, args) => this.Show(); viewForm.Show(); this.Hide(); } }
public AllInOneForm() { InitializeComponent(); sortForm = new SortForm(null); PrepareForm(sortForm); tabControl.TabPages[0].Controls.Add(sortForm); sortForm.Show(); massTagForm = new MassTagForm(null); PrepareForm(massTagForm); tabControl.TabPages[1].Controls.Add(massTagForm); massTagForm.Show(); viewForm = new ViewForm(null); PrepareForm(viewForm); tabControl.TabPages[2].Controls.Add(viewForm); viewForm.Show(); duplicatesForm = new DuplicatesForm(null); PrepareForm(duplicatesForm); tabControl.TabPages[3].Controls.Add(duplicatesForm); duplicatesForm.Show(); renameTagForm = new RenameTagForm(); PrepareForm(renameTagForm); tabControl.TabPages[4].Controls.Add(renameTagForm); renameTagForm.Show(); settingsForm = new SettingsForm(seperateWindow: false); PrepareForm(settingsForm); tabControl.TabPages[5].Controls.Add(settingsForm); settingsForm.Show(); forms = new List <Form>(); forms.Add(sortForm); forms.Add(massTagForm); forms.Add(viewForm); forms.Add(duplicatesForm); forms.Add(renameTagForm); forms.Add(settingsForm); FormClosing += Application_Exit; //tabControl.Selected += TabControl_Selected; var newMinSize = (tabControl.SelectedTab.Controls[0] as Form).MinimumSize; newMinSize.Width += 25; newMinSize.Height += 60; MinimumSize = newMinSize; }