vb6 输出错误 数字填补

用VB6,在label框输出数字,本来该是计算结果和本身数字相加的,但是现在是在label原框中的数字后面补上了新加上的数字,也就是11+22=1122这样的问题附:程序... 用VB6,在label框输出数字,本来该是计算结果和本身数字相加的,但是现在是在label原框中的数字后面补上了新加上的数字,也就是11+22=1122这样的问题

附:程序
Private Sub Command9_Click()
Dim a, b, c, d, e, f, g, h As Integer
a = Label2.Caption
b = Text2.Text
If a + b > 175 Then
b = 175 - a
Label2.Caption = 175
Else
d = a + b
Label2.Caption = d
End If
c = Label22.Caption
d = Label17.Caption
e = Label18.Caption
f = Label19.Caption
g = Label20.Caption
h = Label21.Caption
If a + b < 120 Then
c = c + 5 * b
Label22.Caption = c
d = d + b
Label17.Caption = d
e = e + b
Label18.Caption = e
f = f + b
Label19.Caption = f
g = g + b
Label20.Caption = g
h = h + b
Label21.Caption = h
Label2.ToolTipText = "未飞升"
Command11.Visible = True
Command11.Enabled = False
End If
If a + b > 145 Then
c = c + 5 * b + 10
Label22.Caption = c
d = d + b
Label17.Caption = d
e = e + b
Label18.Caption = e
f = f + b
Label19.Caption = f
g = g + b
Label20.Caption = g
h = h + b
Label21.Caption = h
Label2.ToolTipText = "已飞升"
Command10.Visible = True
Command10.Enabled = False
End If
If a + b < 146 And a + b > 119 Then
Command10.Visible = True
Command10.Enabled = True
Command11.Visible = True
Command11.Enabled = True
End If
b = 5 * a + 50
c = Label5.Caption
d = Label6.Caption
Label3.Caption = b + c * 4
Label4.Caption = b + d * 4
End Sub
展开
 我来答
chinaboyzyq
2011-05-17 · TA获得超过1.3万个赞
知道大有可为答主
回答量:1.3万
采纳率:89%
帮助的人:3243万
展开全部
定义变量方式有错误,如下更正:
Dim a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer, h As Integer
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式