Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir/Mam

i have a login form. As a user get authenticated so that login form should get closed and one mdi form will opens. After closing the mdiform(or logout) my login form must be reappear as it happens in the Skype Application.

How can i do this ?

Please Help me .

i will eagerly waiting for response.

Thanking you.

Sanjay Gupta
Posted

On MDI form, you can open the login form in FormClosing or FormClosed event handler.
 
Share this answer
 
v2
You could simply use the Closing or Closed event or even the ApplicationExit of the Application to restart your program.

Have a look here for more info:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.applicationexit.aspx[^]

Good luck!
 
Share this answer
 
I'd handle this very close to the program entry point. If you look in your main function you'll probably see something like this:

Application.Run(new Form1());


You can create a loop here to do your stuff:

while (condition)
{
    Application.Run(new LoginForm());
    Application.Run(new MainForm());
}


but you'll need some extra logic for the authentication etc..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900