private void buttonExclude_Click(object sender, EventArgs e) { ChangeButtonColor(buttonExclude.Name); HideAllControls(); UCIncludeExclude Exclude = null; if (panelToolsMain.Controls.Find("Exclude", false).Count() < 1) { Exclude = new UCIncludeExclude(); Exclude.IsInclude = false; Exclude.Name = "Include"; Exclude.Dock = DockStyle.Fill; panelToolsMain.Controls.Add(Exclude); } else { Exclude = panelToolsMain.Controls.Find("Exclude", false)[0] as UCIncludeExclude; Exclude.Show(); } }