A
Andrejko
Guest
Since the Forms collection no longer exists in VB.NET, how do you determine whether a form is already running?
In other words, what is the .NET equivalent of the following VB6 code:
Sub CheckFormStatus(ByRef f As System.Windows.Forms.Form)
Dim I As Short
For I = 0 To Forms.Count - 1
If Forms(I).Tag = f.Tag Then
'this window is already loaded - check if minimized
If Forms(I).WindowState = 1 Then
f.WindowState = System.Windows.Forms.FormWindowState.Normal
End If
Exit For
End If
Next I
f.BringToFront()
End Sub
In other words, what is the .NET equivalent of the following VB6 code:
Sub CheckFormStatus(ByRef f As System.Windows.Forms.Form)
Dim I As Short
For I = 0 To Forms.Count - 1
If Forms(I).Tag = f.Tag Then
'this window is already loaded - check if minimized
If Forms(I).WindowState = 1 Then
f.WindowState = System.Windows.Forms.FormWindowState.Normal
End If
Exit For
End If
Next I
f.BringToFront()
End Sub