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現在可以工作了.. –