Text1、Text2、Text3中依次输入3、1、2 Private Sub Form_Click() Dim a As Single, b As Single a = Text1.Text: b = val(Text2.Text+text3.text) Label1.Caption = Str(a * a + b * b) End Sub 能告诉我一步步的过程么?
Private Sub Form_Click() Dim a As Single, b As Single a = Text1.Text: b = Val(Text2.Text + Text3.Text) 'a=3,b=12,这里的"+" 为连接符,因为text2和text3都是字符型,一般都用 & 符号 Label1.Caption = Str(a * a + b * b) ' a和b已经定义类型,所以这里的 + 是数值相加,即153 End Sub