代码如此,我做了个进度条,可是我想进度条到100%就执行MsgBox显示文字("通知"为标题,"成功"为内容)
或者在20%、50%任意一个小于100%的时候就显示MsgBox文字,应该怎样搞呢?
Private Sub Form_Load()
Picture1.ForeColor = vbBlue
Picture1.FontBold = True
Picture1.AutoRedraw = True
End Sub
Private Sub Command100_Click()
Dim i As Long, j As Long
For i = 1 To 20
For j = 1 To 100000
DoEvents
Next
Call Progress(i * 5)
Next
End Sub
Private Sub Progress(percent As Long)
Dim msg As String
msg = percent & "%"
With Picture1
.Cls
Picture1.Line (0, 0)-(percent / 100 * .ScaleWidth, .ScaleHeight), vbGreen, BF
.CurrentX = (.ScaleWidth - .TextWidth(msg)) / 2
.CurrentY = (.ScaleHeight - .TextHeight(msg)) / 2
Picture1.Print msg
.Refresh
End With
End Sub