Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a WinForm on Startup
Message
 
To
03/10/2002 08:22:24
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00707263
Message ID:
00707270
Views:
28
Jerry,

In my app the Main() method is in a class, not the main form. The main form has a field (called 'selForm' in the code below) that holds a reference to a special mdi child form which I use as a "function selector" form for the user.

In the main form's constructor, after the InitializeComponent() call, I create the selector form:
private void ShowViewSelector()
{
	if (this.selForm == null || this.selForm.IsDisposed)
	{
		selForm = new SelectorForm();
	}

	// closing the form loses the mdiparent property
	selForm.MdiParent = this;
	selForm.Show();
	selForm.BringToFront();
}
(The checks for null and IsDisposed is because the user can re-open the selector form from the menu if they closed it.)

So when the main form first displays, it also contains this child form. Is this what you're trying to do?

Roger

>I have a C# project that uses a MdiContainer WinForm as the project's main shell form.
>
>When the project to run, the main form starts up as expected. But how do I make another form (child form) also display at startup?
>
>In my main form Main() method I do this to display the main form:
> Application.Run(new MainForm());
>
>This is fine, but I can't seem to issue that command again to start another form.
Previous
Reply
Map
View

Click here to load this message in the networking platform