Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to exit sub of form1 using form2?
#6
Well, you just need to pop something like this into your code!!

Code:
Public Sub GetUserPermission(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
        Dim response As DialogResult
        response = MessageBox.Show("Do you really want to close?", "Really?", MessageBoxButtons.YesNoCancel) 'Show the message box
        If Not (response = Windows.Forms.DialogResult.Yes) Then
            'The user does not wish to close the form! Bail! Bail!!
            e.Cancel = True
        End If
    End Sub
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Re: How to exit sub of form1 using form2? - by brandonio21_phpbb3_import2 - 06-08-2012, 02:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exit code ? lvlasked 1 8,872 06-30-2011, 10:36 AM
Last Post: lvlasked

Forum Jump:


Users browsing this thread: 1 Guest(s)