I'm new to the VB.net programming and I'm trying to convert the following piece of code:
Private Sub Command1_Click()
Dim blnFind As Boolean
Dim objForm As Form
Dim myForm As Form2
blnFind = False
For Each objForm In Forms
If objForm.Name = "Form2" Then
blnFind = True
Set myForm = objForm
End If
Next objForm
If blnFind = False Then
Set myForm = New Form2
myForm.Show
myForm.Caption = strTitle
Else
myForm.WindowState = vbNormal
myForm.SetFocus
End If
End Sub
I've tried several ways but I don't find a solution to it.
The VB.net upgrade wizard gives a failure to this type of update.
Live fast, die young and leave a beautiful corpse behind.
Private Sub Command1_Click()
Dim blnFind As Boolean
Dim objForm As Form
Dim myForm As Form2
blnFind = False
For Each objForm In Forms
If objForm.Name = "Form2" Then
blnFind = True
Set myForm = objForm
End If
Next objForm
If blnFind = False Then
Set myForm = New Form2
myForm.Show
myForm.Caption = strTitle
Else
myForm.WindowState = vbNormal
myForm.SetFocus
End If
End Sub
I've tried several ways but I don't find a solution to it.
The VB.net upgrade wizard gives a failure to this type of update.
Live fast, die young and leave a beautiful corpse behind.