Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why is this happening??
Message
 
To
29/01/2009 13:43:57
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01378204
Message ID:
01378284
Views:
11
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform