Good afternoon everyone, I have the following existential doubt, I have a WindowsForms MDI Parent form , in which I show a series of windows, but in the event Load I need to upload a Login form , which, by pressing the Validate button, if the user is correctly authenticated, enable the menus , close the < strong> form of the Login and can run the different applications, the code I am using is the following:
public void MuestraLogin()
{
frmLogin objLogin = new frmLogin();
objLogin.MdiParent = this;
objLogin.Show();
}
public void InhabilitaMenus()
{
try
{
menuStrip1.Enabled = false;
menuStrip1.Visible = false;
}
catch (Exception ex)
{
ex.ToString();
}
}
public void ObtenerValidacion(bool valido)
{
try
{
if (Valido)
{
menuStrip1.Visible = true;
menuStrip1.Enabled = true;
}
}
catch (Exception ex)
{
ex.ToString();
}
}
private void frmMenu_Load(object sender, EventArgs e)
{
MuestraLogin();
InhabilitaMenus();
}