Disasterpiece Posted April 22, 2003 Posted April 22, 2003 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 :) Quote
*Experts* Volte Posted April 22, 2003 *Experts* Posted April 22, 2003 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. Quote
Disasterpiece Posted April 24, 2003 Author Posted April 24, 2003 That never worked for me...anything else I can do? Quote
*Experts* Nerseus Posted April 24, 2003 *Experts* Posted April 24, 2003 Don't hide the Login window, you have to use Close. Maybe that's the problem? -Nerseus Quote "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
Disasterpiece Posted April 24, 2003 Author Posted April 24, 2003 If I say frmMain.Show(), then Me.Close() to close the login, the entire program exits. Quote
Cassio Posted April 25, 2003 Posted April 25, 2003 You can use application.exit to close the entire program. Quote Stream of Consciousness (My blog)
*Experts* Volte Posted April 25, 2003 *Experts* Posted April 25, 2003 Disasterpiece: did you make sure to set the Startup Object to frmMain (or whatever the form is called)? Quote
iebidan Posted April 25, 2003 Posted April 25, 2003 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 Quote Fat kids are harder to kidnap
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.