Hi,

In my application, I have given the user the option of using a login form in order to password protect his application, if he chooses to use the form, then a simple login form pops up right after the splash screen and asks for a password, if he answers the right password then the main form opens up...
My problem is that I set the mainform as my startup form and in the load event I set it to check wether the user checked the option (the boolean is stored in the database) for the login form, if he did then the login form pops up asking for a password, everything works fine until he presses cancel, I set it to close the main form and the login form as soon as he presses cancel but for some reason the main form still executes the remaining code in the load event, which i do not want, is there no way to tell vb that as soon as he presses cancel in the login form to immediately close the application instead of having continue the loading of the main form?

Code:
     
If settingsDataSet.settings.Rows(0)(20).ToString = "true" Then
Login.ShowDialog()
if Login.Verify = false then
me.close()
else 'Continue LOAD Code in Main Form