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 展开
附:程序
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 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询