我正在尝试通过Visual Studio 2013获得Visual Basic。我一周前开始上课,所以我很无能为力。我所知道的是如何创建一个新项目,一般选择Form和声明中选择Activated。最后,我得到了以下代码:
Public Class Form1
Private Sub Form1_Activated(sender As Object, e As EventArgs) Handles Me.Activated
a = 3
b = 2
c = a + b
Print(c)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
非常确定需要删除的内容。我尝试用Int声明a,b和c但是没有帮助,我仍然得到同样的错误。我尝试删除除
之外的所有内容Private Sub Form1_Activated(sender As Object, e As EventArgs) Handles Me.Activated
a = 3
b = 2
c = a + b
Print(c)
End Sub
但后来我得到错误Statement在命名空间中无效。
答案 0 :(得分:1)
您没有声明任何内容。在VB.NET中,您Chrome's Command Line API并指定它的数据类型。
Dim a As Integer = 3
Dim b As Integer = 2
Dim c As Integer = a + b
虽然它们很相似,但VB.NET和VS 6.0却不同。