I have a custom created user control with a label and a picture box, which I will be using as a button in a form. The problem is that when I add an action to the UC_Click
event and run the application I doesn't recognize when I click it. Is there a fix for this?
private void OpenChildForm(Form childForm, Panel panelTab)
{
if (currentChildForm != null)
{ currentChildForm.Close(); }
currentChildForm = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
panelTab.Controls.Add(childForm);
panelTab.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}
private void UCDepartment_Click_1(object sender, EventArgs e)
{
OpenChildForm(new AdministratorChildForms.DepartmentManagment(), panelTab);
}