Solved

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

Posted on 2004-04-19
6
424 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now