How to dispose the login screen

A

appearinggalaxy

After the login has been authenticated successfully, I written the
code below to call the main form:

dim loMainForm as new MainForm
MainForm.ShowDialog()
Me.close

What happend is the MainForm is display but the login screen still
havent been disposed until I close the MainForm, what's wrong with my
code? May I have your advise? Thanks.

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
C

Cor Ligthert

Vincent,

As you use "mainform", than for good programming that should be the main
form (not for the compiler however for readability of your program).

There is no need for code to show it, because that is automatically done
after the load event (When you do not close it in the load event).

A showdialog can be an extra form, to show up during the loading of the form
to get some user information.

As a very simplified sample, (it can much nicer)
\\\
Private sub LoadEvent ......................................
dim frm as myPasswordChecking
frm.showdialog
if frm.passwordOK = False then me.close
frm.dispose
End sub
///

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top