Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why is this happening??
Message
 
À
29/01/2009 13:43:57
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01378204
Message ID:
01378284
Vues:
9
>I have some code in a custom contol that is trying to run code in the form that the control is placed on. I want the code to be written in the control so I don't have to duplicate it for each contol I place on the form (I hear that's good programming practice :).
>
>Here's the code:
>
>MainWin1 = (MainWindow)this.TopLevelControl;
>MainWin1.MainMenu(MainWindow.MenuName.search);
>

>Application.Run(mainwin); - This turns NULL for some reason.
>

I don't really do much Winforms development so YMMV, but I've been under the impression Application.Run() was meant to kick off the message event loop and you did this only once when your app. starts. All other forms are just displayed with:
Form form1 = new NameOfForm();
form.Show();
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform