Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 100
End Sub
Private Sub Command1_Click()
If Text1.Text = "" Then
Text1.SetFocus
MsgBox "您还没有输入充值数", vbOKOnly, "操作错误"
ElseIf Not IsNumeric(Text1.Text) Then
Text1.Text = ""
Text1.SetFocus
ElseIf Text1.Text > 100 Then
Text1.Text = ""
Text1.SetFocus
Else
Me.ProgressBar1.Value 碰链= Text1.Text
Timer1.Enabled = True
End If
End Sub
Private 肢知Sub Timer1_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value - 1
Me.Text2.Text = "加油进度" & Format(Me.ProgressBar1.Value / Me.ProgressBar1.Max, "Percent")
Line1.X2 = Text1.Text
If Me.ProgressBar1.Value = Me.ProgressBar1.Min Then
Timer1.Enabled = False
Me.ProgressBar1.Value = 0
Text2.ForeColor = &HC0&
Text2.Text 历吵消= "加油完成"
End If
End Sub
http://www.namipan.com/d/139f5acf4df709f78e9d6a6b199c4dd7bc2ee26015e32400
下载地址