1
我无法在文本框中添加2个整数。如果我添加1 + 1,我得到11在2个文本框中添加2个数字
请帮助..
这里是我的代码:
Private Sub cmdAdd_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = CInt(TextBox1.Text)
b = CInt(TextBox2.Text)
c = CInt(TextBox3.Text)
TextBox3.Value = TextBox1.Value + TextBox2.Value
c = a + b
End Sub
我用这个代码和它的作品太:
x = CDbl(txtSurveyYes.Value) + CDbl(txtSurveyNo.Value)
txtTotal.Value = x
'cint'尝试,而不是VAL,你是串联 –
这样的事情? a = CInt(TextBox1.Text) b = CInt(TextBox2.Text) c = CInt(TextBox3.Text) –
谢谢Nathan..It现在可以工作了.. –