command color随时变

来源:百度知道 编辑:UC知道 时间:2024/05/15 03:38:39
Private Sub Command12_Click()
Label9.Caption = Val(Label9.Caption) + Val(Command12.Caption)
Command12.Visible = False
Command12.Enabled = False
Command8.Caption = Command4.Caption
Command8.Visible = True
Command8.Enabled = True
End Sub

Private Sub Command2_Click()
Timer4.Enabled = True
End Sub

Private Sub Command4_Click()
Label9.Caption = Val(Label9.Caption) - Val(Command4.Caption)
Command4.Visible = False
Command4.Enabled = False
Command6.Caption = Command4.Caption
Command6.Visible = True
Command6.Enabled = True
End Sub

Private Sub Command5_Click()
Label9.Caption = Val(Label9.Caption) - Val(Command5.Caption)
Command5.Visible = False
Command5.Enabled = False
Command7.Caption = Command5.Caption
Command7.Visible = True
Command7.Enabled = True
End Sub

Private Sub Command6_Click()
Label9.Caption = Val(Label9.Caption) + Val(Comma

给你个示例: 前提(设置命令按钮的Style属性为1
Command6.Caption = Val(Command6.Caption) + Val(Int(2001 * Rnd - 10000))
上面是你以前的代码
这样改
T=Val(Int(2001 * Rnd - 10000))
If T>0 Then
Command6.BackColor=RGB(0,255,0)
Else
Command6.BackColor=RGB(255,0,0)
End If
Command6.Caption=Val(Command6.caption)+T