Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I know that a Form already exists?
Message
 
À
10/06/2002 02:17:59
Czarina Joyce Villanueva
Innovision Systems International
Manila, Philippines
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00664859
Message ID:
00666714
Vues:
25
This is how I run only once a form in an MDI enviroment

private frmOrders objOrders=null;


try
{
//frmOrders objOrders=null;
foreach(Form f in this.MdiChildren)
{
if(f is frmOrders) //found it
{
objOrders=(frmOrders) f;
break;
}
}
if(objOrders != null && objOrders.IsDisposed==false)
{
objOrders.Show();
objOrders.Focus();
}
else
{
objOrders=new frmOrders();
objOrders.Show();
objOrders.Focus();
}
}
catch(Exception eo)
{
MessageBox.Show("Error \n" + eo.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform