Okay the two forms in question are UserInfo and RunAs. I want RunAs to
display first, and then go to UserInfo.
In Program.cs I switched to Application.Run(new UserInfo());
Then in the constructor of UserInfo I changed it to:
public UserInfo()
{
InitializeComponent();
ShowDialog(new RunAs());
}
But what happens now is that when I run the app it shows me the UserInfo
form, then when I close that form it shows me another instance of the
UserInfo form.
Steve
"Ciaran O''Donnell" <Ci************@discussions.microsoft.comwrote in
message news:4E**********************************@microsof t.com...
You should show the first form as a dialo with ShowDialog() from Main,
then
when OK is clicked, Open the seconds form and application.Run(secondform)
so
it controls the message loop and closes the app when it closes.
Ciaran O'Donnell.
"-Steve-" wrote:
>In my app I have a form that after the user hits ok switches to another
form, never to return to the first form again.
I thought this code would do the trick:
UserInfo child = new UserInfo();
child.Show();
this.Visible = false;
And it works fine except that when I close the UserInfo form the app
remains
open, it's just not visible. What's the better way to handle this?
Steve