checking previous instance of form
Hello,
I have a form1,from the context menu i am calling the form2
The form2 is loaded fine.Once again if i am again accessing
the context menu clicking.One more copy of form2 is loaded.
If the previous instance of form2 is loaded and active.
Then i do not want to load it again.
How to do this in vb.net.It is easy for me in vb6.
Thanks and regards
shawlin
Re: checking previous instance of form
If you want to check for form instances , something like this would work :
VB Code:
'put this in the general declaration form
Dim FRM2 As New Form 'or if you have another form replace it here
Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
If Not FRM2 Is Nothing Then 'allows one instance of the form named Form
FRM2.Show()
Else
FRM2 = Nothing
End If
End Sub