hi,
i'm developing an MDI application and i'd like to open just one instance of a form. i tried the code below and it works when the form is loaded for the first time, but if i close the form and try to open it again i receive this error message: CANNOT ACCESS A DISPOSED OBJECT NAMED "frmUsuario".
thanks,
benedito.
i'm developing an MDI application and i'd like to open just one instance of a form. i tried the code below and it works when the form is loaded for the first time, but if i close the form and try to open it again i receive this error message: CANNOT ACCESS A DISPOSED OBJECT NAMED "frmUsuario".
Code:
Dim fUsuario As frmUsuario
Private Sub mniUsuario_Click(ByVal sender As
System.Object,
ByVal e As System.EventArgs)
Handles mnuUsuario.Click
If fUsuario Is Nothing Then
fUsuario = New frmUsuario
End If
fUsuario.MdiParent = Me
fUsuario.Show()
End Sub
thanks,
benedito.