private void Advanced_Click(object sender, EventArgs e) { try { //removes panel allowing for room for replacement panel with updated information if (Form1.Instance.PnlContainer.Controls.ContainsKey("sectionTest")) { var panel = Form1.Instance.PnlContainer.Controls["sectionTest"]; panel.Dispose(); } //new panel being made sectionTest st = new sectionTest(); st.Dock = DockStyle.Fill; Form1.Instance.PnlContainer.Controls.Add(st); //displays sectiontest Form1.Instance.PnlContainer.Controls["sectionTest"].BringToFront(); //ensures error label is inisible because files were found errorLabel.Visible = false; } catch { //if files were empty an error will be thrown and display the error label for user errorLabel.Visible = true; } }
private void Submit_Click(object sender, EventArgs e) { try { //will hold textbox elements that are selected List <String> chosen = new List <String>(); //gets textbox elements chosen checkBoxList(chosen); //removes panel allowing for room for replacement panel with updated information if (Form1.Instance.PnlContainer.Controls.ContainsKey("sectionTest")) { //gets panel sectiontest var panel = Form1.Instance.PnlContainer.Controls["sectionTest"]; //removes panel panel.Dispose(); } //new panel being made sectionTest st = new sectionTest(chosen); st.Dock = DockStyle.Fill; Form1.Instance.PnlContainer.Controls.Add(st); //displays sectionTest panel for user Form1.Instance.PnlContainer.Controls["sectionTest"].BringToFront(); //removes sibility on errorlabel because error no longer occurs errorLabel.Visible = false; } catch { //display error label if no sigs are in file errorLabel.Visible = true; } }