• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 779
  • Last Modified:

Muliple form close buTTOn

hi I have 3 forms opened and on 3rd form I would like to add button that will close whole exe.file i MEAN all 3 forms

thx
0
owl111
Asked:
owl111
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can end the application from a button on the third from like this:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Application.Exit()
    End Sub

From the Help file:
CAUTION   The Form.Closed and Form.Closing events are not raised when the Application.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form.Close method for each open form individually before calling the Exit method.

~IM
0
 
owl111Author Commented:
Thanks a lot.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now