I have a login form and the other form which contain the operation to be perform
In login form Submit Button, i am validating the emp code from database
If it is proper then i am writing

frm.Show();
this.Hide();

frm is the second form to be shown
My application is running fine
After successful operation i am asking the user to close the application if yes it closes
But it still running in the background as i see in task manager
I am not getting what is going on

Recommended Answers

All 2 Replies

If you want to exit from project then use

Application.exit();

rather than

this.close();

Or

While closing Check the open login form like this way

foreach (Form ab in Application.OpenForms)
             {
                 if (ab is LoginForm)
                 {
                     ab.exit();
                 }
             }

Cheers....

Another option is to open the main application form when the application starts (the frm form) and immediately hide it, and then show the login form. That's what I usually do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.