public void ShowSurvey(object sender, EventArgs e) { try { survey = new ControlSurvey(); panelContainer.Controls.Clear(); survey.Dock = DockStyle.Fill; panelContainer.Controls.Add(survey); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnMenuWork_Click(object sender, EventArgs e) { btnMenuWork.Enabled = false; btnMenuLicense.Enabled = true; btnMenuReport.Enabled = true; panelLeft.Controls.Clear(); panelContainer.Controls.Clear(); cwl = new ControlWorkMenuLeft(); survey = new ControlSurvey(); cwl.Dock = DockStyle.Fill; survey.Dock = DockStyle.Fill; panelLeft.Controls.Add(cwl); panelContainer.Controls.Add(survey); GC.Collect(); }