I'm sure I'm doing my login process for my app in a not so perfect way, but as with lots of things, it works. The issue is to make it work I have to use the very unpopular DoEvents thing.
I would like my application to show a login screen before loading my main form. Currently I have a login dialog box with a FormOpen boolean property and an authenticated boolean property. If a user logs in successfully, I hide the login form, set formopen to false, and authenticated to true. If they cancel out, then I do the same and just set the authenticated property to false. If authenticated=false then I end the app, else I show the main form via application.run(MainForm)
Shared Sub Main()
Using frmLogin1 As New LoginForm
frmLogin1.Show()
Do While frmLogin1.FormOpen = True
Application.DoEvents()
Loop
If frmLogin1.Authenticated = False Then End
End Using
ModuleRegistration.Register()
Application.Run(MainForm)
End Sub
Is there a more preferred way of doing this?