Reputation: 1
I am simply trying to open a new form using 'Exercise.show()' as this has work until now, however with this Exercise form, it is not being shown as an option as a form so I cannot open it. What should I do here?
Private Sub Exercises_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Exercises.Click
Exercises.Show()
Me.Hide()
End Sub
Upvotes: 0
Views: 5337
Reputation: 457
If your actual form is called 'Exercises' then you need to type:
Dim frm As New Exercises frm.ShowDialog()
Thanks
Eddy Jawed
Upvotes: 1
Reputation: 4741
Dim objPDetails As PFErrors
Dim IsOpen As Boolean = False
For Each f As Form In Application.OpenForms
If f.Name = "PFErrors" Then
IsOpen = True
f.Focus()
Exit For
End If
Next
If IsOpen = False Then
objPDetails = New PFErrors
objPDetails.WindowState = FormWindowState.Maximized
objPDetails.MdiParent = Me
objPDetails.Show()
End If
Upvotes: 0
Reputation: 13250
Try this:
Dim oForm As Exercises
oForm = New Exercises()
oForm.Show()
Upvotes: 1