C
Coderz
Before I am using MDI form to open a child form. But I decided not to
use MDI and now wondering how can I prevent a windows form from
loading or opening again.
Here's the code I used before:
Private Function IsOpen(ByVal nameForm As String) As Boolean
Dim childfrm As Form
Dim strNaam As String
Dim intPuntje As Integer
For Each childfrm In Me.MdiChildren
strNaam = childfrm.GetType.ToString
intPuntje = strNaam.LastIndexOf(".")
strNaam = Mid(strNaam, intPuntje + 2, Len(strNaam) -
intPuntje)
If LCase(strNaam) = LCase(nameForm) Then
childfrm.BringToFront()
Return True
End If
Next
Return False
End Function
http://www.sourcecodester.com - Download free source code
use MDI and now wondering how can I prevent a windows form from
loading or opening again.
Here's the code I used before:
Private Function IsOpen(ByVal nameForm As String) As Boolean
Dim childfrm As Form
Dim strNaam As String
Dim intPuntje As Integer
For Each childfrm In Me.MdiChildren
strNaam = childfrm.GetType.ToString
intPuntje = strNaam.LastIndexOf(".")
strNaam = Mid(strNaam, intPuntje + 2, Len(strNaam) -
intPuntje)
If LCase(strNaam) = LCase(nameForm) Then
childfrm.BringToFront()
Return True
End If
Next
Return False
End Function
http://www.sourcecodester.com - Download free source code