G
Guest
Hello, I have not been able to find any reference on the great www on how to
control the number of same MDI Child Forms. Basically i want to prevent my
users from opening more than one copy of the same child form in certain
circumstances.
this kinda works but i would have to reset the static var when i close the
form... is there a better way?
Private Sub mnuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuItem.Click
Dim MyChildForm As New frmNameHere
Static intCount As Integer 'STATIC TO MAINTAINS ITS VALUE
'INCREMENT THE CAPTION COUNTER.
intCount += 1
If intCount <= 1 Then
Me.Text = Me.Text & " - " & MyChildForm .Text '& " " &
intCount.ToString()
With MyChildForm
.MdiParent = Me
.Show()
End With
End If
End Sub
Please help
THX
control the number of same MDI Child Forms. Basically i want to prevent my
users from opening more than one copy of the same child form in certain
circumstances.
this kinda works but i would have to reset the static var when i close the
form... is there a better way?
Private Sub mnuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuItem.Click
Dim MyChildForm As New frmNameHere
Static intCount As Integer 'STATIC TO MAINTAINS ITS VALUE
'INCREMENT THE CAPTION COUNTER.
intCount += 1
If intCount <= 1 Then
Me.Text = Me.Text & " - " & MyChildForm .Text '& " " &
intCount.ToString()
With MyChildForm
.MdiParent = Me
.Show()
End With
End If
End Sub
Please help
THX