- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a question on how to exit a program with an Exit button. I have all my personalized commands in the myCommands.vb file. I also have a form1.vb file I want to use as a user interface. On my form there is a button to continue the program and there is a button to exit the program.
Below is the Form1 coding:
Public Class Form1 Private Sub bExit_Click(sender As Object, e As EventArgs) Handles bExit.Click Stop End Sub Private Sub bGo_Click(sender As Object, e As EventArgs) Handles bGo.Click Me.Hide() End Sub End Class
Below is the coding that calls form1 from the myCommands file:
<CommandMethod("BNOT")> Sub BuildNotification() Dim frm1 As New Form1 frm1.Show() (the rest of the program.......) frm1.Dispose() End Sub
The command works properly when the "Go" button (the button that causes the program to proceed) is clicked. The problem is that when the Exit button is clicked, the program continues. I see that the Stop command in the exit button only works on form1. My question is how can I get form1 to pass the stop/exit command back to the mycommands file to stop the program altogether?
Thank you for your time,
Jarrod
Solved! Go to Solution.