Hello,
my app opens a 2nd form (form2) by clicking a button on the first form
(form1). I do not want to open form2 in modal form, but I only want one
instance of form2 open. So if someone re-clicks the button on form1 there
will not be multiple instances of form2. I created a module level boolean
var in form1 and a property in form1 to control the loading of form2, but I
am having a problem resetting the value of this boolean var. Here is what I
have:
'--in form1 I have this property
Public Property frmLoaded() As Boolean
Get
Return bFrmLoaded
End Get
Set(ByVal Value As Boolean)
bFrmLoaded = Value
End Set
End Property
Sub...
If bFrmLoaded.Equa ls(False) Then
form2.Show
bFrmLoaded = True
End If
....
End Sub
In form2 in the closing event I want to reset the value of bFrmLoaded to
False. But when I set a form var to form1 - it is a new instance of the form
Dim frm As New form1
frm.frmLoaded = False
The original form1 does not receive this. I can't remember how I dealt with
this in the past. I have done this before. Just can't remember what I did.
Or is there a better approach to dealing with keeping only one instance of a
form (which is not in modal form or mdi, etc)?
Any suggestions appreciated on how to reset the form1 bFrmLoaded boolean
var from form2.
Thanks,
Rich