Hi all,

I've got a class called Startupforms as my startup project with the following code.

VB Code:
  1. Public Class StartupForms
  2.     Shared Sub Main()
  3.         Dim SplashForm As New FrmSplash 'this is your first form
  4.         Dim LoginForm As New FrmLogin 'this is your second form
  5.         Dim MainForm As New FrmMAIN
  6.         SplashForm.ShowDialog() 'open first form
  7.         LoginForm.ShowDialog() 'open second form
  8.         MainForm.ShowDialog()
  9.     End Sub
  10.  
  11. End Class

Now on the second form which opens, there's a command button with code

VB Code:
  1. Application.Exit()

if the user desires to exit the application. (This is a login form)

When the user clicks this button, it still opens the application, and flashes on the screen and returns errors and crap cause the user didn't logon and the connection wasnt made. Actually it's behaving worse than a baby.

How can I when the user clicks on the exit button on the second form, halt the class, and exit the application without executing the rest of the class?

Thanks

Rudi