Link to home
Start Free TrialLog in
Avatar of thenrich
thenrich

asked on

Login form

I've created a login form where user types in credentials. Once the credentials are validated I want to close the login form and launch another form which would be the main application thread. What is the appropriate way to do this?
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

In windows forms?  

You can do a Form1.Hide and Form2.show
Avatar of thenrich
thenrich

ASKER

The problem with that is that the application never closes then.
For exit out of application use Application.Exit()

As you are Hide the for opening another form instead of hide use close form.


Another solution is dont keep your LoginForm as main form.

Instread of that use another form as a mainform and in that load event of another form use loginform.showdialog()
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I jumped the gun - I like this idea better