Good I have this question of how to call a function, I have a form that handles "Panel" (Panels) and it has its buttons inside the main form and in a panel I have a child form, I would like to know how to execute a function of the child form inside the panel
private void AbrirFormInPanel(object FormHijo)
{
if (this.PanelCentral.Controls.Count > 0)
this.PanelCentral.Controls.RemoveAt(0);
fh = FormHijo as Form;
fh.TopLevel = false;
fh.Dock = DockStyle.Fill;
this.PanelCentral.Controls.Add(fh);
this.PanelCentral.Tag = fh;
fh.Show();
}
private void btnUsuarios_Click(object sender, EventArgs e)
{
AbrirFormInPanel(new Panel_Usuarios());
}
private void btnES_Click(object sender, EventArgs e)
{
AbrirFormInPanel(new Panel_Registros());
}
private void Principal_Load(object sender, EventArgs e)
{
AbrirFormInPanel(new Panel_Registros());
}
For example, I would like to push the "btnES" button to execute a function that is in the "Panel_Users" form, in case the panel that is open is "Panel_Users"