I'm attempting to write a VB.Net program where if any of my code returns an error, the program closes. Here's what I'm trying, but its not working. I've tried both Application.Exit() and Me.Close(). Neither seems to work, the program just continues on. Can someone please tell me what I'm doing wrong?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'call the main funtion
Private Sub theFunction
here's where my code goes
'there was an error, need to quit the program
Private Sub QuitApp()
here's where my code goes to close all open objects