我的名字是Alex,我是VB的新手.对不起,我不在话题了.我只有一个问题:任何人都可以尝试将我引导到一个链接(或直接解释),以便更好地理解Visual Basic标签的工作原理吗?我需要了解标签和变量之间的差异以及我们如何使用标签.到目前为止,我只使用了freebasic来进行一些小编程(构建一个小型计算器等),我真的很赞同你的答案.现在我正在使用Visual Studio 2010,我正在学习一些教程,只是给我代码而不解释一切是如何工作的.例如,在构建计算器时,教程使用此代码作为等号"=":
If Label2.Text > "" And Label2.Text = "+" Then
Button1.Text = Val(Label1.Text) + Val(Button1.Text)
Label3.Text = Button1.Text
ElseIf Label2.Text > "" And Label2.Text = "-" Then
Button1.Text = Val(Label1.Text) - Val(Button1.Text)
Label3.Text = Button1.Text
ElseIf Label2.Text > "" And Label2.Text = "*" Then
Button1.Text = Val(Label1.Text) * Val(Button1.Text)
Label3.Text = Button1.Text
ElseIf Label2.Text > "" And Label2.Text = "/" Then
Button1.Text = Val(Label1.Text) / Val(Button1.Text)
Label3.Text = Button1.Text
Else
End If
Run Code Online (Sandbox Code Playgroud)