Question Cannot Declare New Form?

Collaeral

Member
Joined
May 31, 2009
Messages
5
Programming Experience
Beginner
Hey, im kinda new at visual basic so i was wondering if you could help me..

I created a second form in my application and in the first form i wrote:

VB.NET:
Dim frmDialog as new form2

But it does not recognize the second form. :/

I tried changing the name and i get the same result.

Help would be appreciated. Thanks.
 
If form2 doesn't exist then you can't declare a variable as it.

That being said you should be naming your forms with a more descriptive name anyways.
 
frmAceDialog:

Public Class frmAceDialog
Private Sub btnAceDialogAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceDialogAccept.Click
Me.DialogResult = Windows.Forms.DialogResult.OK
If radAceOnePoint.Checked Then
Dim intAcePoints As Integer = 1
ElseIf radAce11Points.Checked Then
Dim intAcePoints As Integer = 11
End If
Close()
End Sub
End Class

In case your wondering, im writing blackjack.
 
This isn't making any sense, try removing (not deleting) the class then re-add it and try to use it in code again?
 
heck that was what the next suggestion would'be been :D

but you know sometimes it happens if you declare a new form outside the event sub...
 
Back
Top