G
Guest
I have FormA that opens FormB on request. Before opening FormB, I'd like to see if it is already open to prevent multiple instances. I'm not sure if I'm on the right track... but I have created a form level variable
dim frmB as frmMyPrintFor
In the button's click event..
If Not frmB Is Nothing The
frmB.BringToFront(
Els
frmB = New frmMyPrintFor
frmB.MdiParent = Me.MdiParen
frmB.Show(
End I
The problems is... when the user opens frmB once, then presses 'Close' (Me.Close) or the X close button, frmB no longer evaluates to 'nothing' and the form is not shown with BringToFront(). I understand that the resources are released after me.close, but how can I make the above code work? I thought I saw an example where someone checked if frmB is Disposing... but I can't find the syntax for that.
I know that I could 'hide' the form instead of actually closing it, but since the form could be called from multiple sources, I'd like not to have the overhead of keeping track of it
Any ideas
Thanks
Denise
dim frmB as frmMyPrintFor
In the button's click event..
If Not frmB Is Nothing The
frmB.BringToFront(
Els
frmB = New frmMyPrintFor
frmB.MdiParent = Me.MdiParen
frmB.Show(
End I
The problems is... when the user opens frmB once, then presses 'Close' (Me.Close) or the X close button, frmB no longer evaluates to 'nothing' and the form is not shown with BringToFront(). I understand that the resources are released after me.close, but how can I make the above code work? I thought I saw an example where someone checked if frmB is Disposing... but I can't find the syntax for that.
I know that I could 'hide' the form instead of actually closing it, but since the form could be called from multiple sources, I'd like not to have the overhead of keeping track of it
Any ideas
Thanks
Denise