Hey Guys,
I am using VB 2008 Express Edition.
I have an app that has 2 forms (will be adding more). Button click on form1 opens form 2. The first time I run my app everything works fine, but when I click the close 'X' button on form 2 and try opening form 2 again by clicking the button on form 1, VB throws a Object Disposed Exception, Cannot access a disposed object
Here is my code on form 1
Can you tell me how to fix this problem.Code:Public Class frmMain Dim myForm As Form3 Private Sub btnWeld1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWeld1.Click If IsDisposed Then Return If myForm Is Nothing Then myForm = New Form3 End If myForm.Show() End Sub End Class
Thanks,
Novice_User




Reply With Quote