|
-
May 11th, 2005, 06:09 AM
#1
Thread Starter
Lively Member
formMain.exitApp() can't work
inside form2, when the exit button is clicked, it will call
formMain's exitApp()
Form2's Code:
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mmuFileExit.Click
Dim formMain1 As frmMain
formMain1.exitApp()
End Sub
FormMain1's Code:
Public Sub exitApp()
Dim dlg As DialogResult
dlg = MessageBox.Show("Exit?")
If dlg = DialogResult.Yes Then
Me.Close()
End If
End Sub
However the error given is:
Object reference not set to an instance of an object!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|