In my project I use mdiParent, I have an open form with showdialog () and from this I invoke another form, the problem is that it only lets me do it once, that is to say I open it for the first time, I close it then I try to open it again and it does not. Here the code:
private void btnVerDespachos_Click(object sender, EventArgs e)
{
try
{
FrmConsultarDespacho frm = Application.OpenForms["FrmConsultarDespacho"] as FrmConsultarDespacho;
if (frm != null)
{
frm.CodigoFactura = _NumFact;
frm.WindowState = FormWindowState.Normal;
frm.BringToFront();
}
else
{
FrmConsultarDespacho llamar = new FrmConsultarDespacho();
llamar.CodigoFactura = _NumFact;
llamar.MdiParent = FrmPrincipal.pantalla;
llamar.Show();
llamar.BringToFront();
}
this.Close();
}
catch (Exception ex)
{
Funciones.MensagedeError(ex.Message);
}
}