Solved

How to close the login form after successful login to show the Main form?

Posted on 2004-04-19
6
431 Views
Last Modified: 2008-03-06

I am working in vb.net. I have a login form and after successfull login I want to close the login form and show the Mdi Main form. But my application exits after the line frmMain.show. How should i make the application running after closing the login form.

Thanks in advance.
0
Comment
Question by:vinodjnair
6 Comments
 
LVL 7

Expert Comment

by:leflon
ID: 10858268
Hi vinodjnair,

is the login form your startup form?
and how do you close the login form?
you may better make frmMain your startup form and open login form as the first action.

leflon
0
 
LVL 4

Expert Comment

by:venishjoe
ID: 10858345
Hai,

   You can try with the hide function and not closing

i.e.,  frmLogin.Hide
and then frmMain.show

Hope this helps

Regards
Venish
0
 

Expert Comment

by:ckiraly
ID: 10863805
hey vinodjinar -

the best way to go is to have your login form seperate from your main form.

have your main form open your login form - in modal mode is best -

then they do the login, or cancel

then you can continue on with a proper login, or close the program if they cancel the log in.

If the continue with proper login, you then just close the login form, and show your main form, then continue on with your process...

Hope this helps...

CK
0
 
LVL 3

Accepted Solution

by:
Phoenixric earned 30 total points
ID: 10925785
Hi,
Can we see the code after the success in log-in?

First thing is that your log-in form should be your star-up form.
Secondly, your form should be an independent form and the MDI child is not set to true.

And presumably after the success in log-in you have a code something like this :

if  LogInSuccess = true
    Unload me -> which unload the log-in form itself
   frmMain.show
else
   Msgbox "Access Denied"
End If

Get back to me if stil doesnt work. Good luck
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question