What I recommend, is that instead of starting your application with a form, start it with "Sub Main". That way you can first validate the username and password by showing the login form, and if the user passes the validation, you show them the actual application form. If not, you display a "Wrong Username Or Password" prompt, and exit the application.
Feel free to post specific code for more help.