Is there a way to program a button on a form so that when it is clicked it aborts the whole program.
Here's the code I have for an OK button (validates what the user types in)

Dim sr As IO.StreamReader = IO.File.OpenText("password.txt")
Dim usernamebox, readusername As String
Dim passwordbox, readpassword As String
Dim lines As Integer
Dim form As New Login()

usernamebox = txtusername.Text.ToUpper
passwordbox = txtpassword.Text.ToUpper

Do While sr.Peek <> -1
readusername = sr.ReadLine.ToUpper
readpassword = sr.ReadLine.ToUpper

If readusername = usernamebox Then
MsgBox(readusername)
If readpassword = passwordbox Then
MsgBox(readpassword)
Exit Do
End If
End If
Loop

if (usernamebox = " ") or (passwordbox = " ")

abort statement here

End If

sr.Close()