Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have 2 forms - a Login Screen and the main program window.

 

When the user logs in, I hide the Login form and show the Main form.

 

My problem is this: When I click the close button in the top right corner on the main form, the Login form is still running (only it's hidden) . How do I get my entire program to close when I hit the X button on the main form?

 

Thanks :)

  • *Experts*
Posted

You could set the Main form as your startup form (thus making it the

form that the running thread depends on and closing it ends the

program), and then show the Login form from the _Load event of

your Main form.

  • *Experts*
Posted

Don't hide the Login window, you have to use Close. Maybe that's the problem?

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

I will suggest that instead of using a form as a startup object you use SUB MAIN and the Application.Run(), so when you finish with the login screen you can dispose it and load the next form, and when you're done using the app use the Application.Exit(), if you don't use the Application.Exit() your app will keep running

 

Regards

Fat kids are harder to kidnap

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...