Sub Command1_Click()
Picture1.ForeColor = RGB(0, 0, 255) 'farve
For I = 0 To 100 Step 2
updateprogress Picture1, I
Next
Picture1.Cls
End Sub
Sub updateprogress(pb As Control, ByVal percent)
Dim num$
If Not pb.AutoRedraw Then
pb.AutoRedraw = -1
End If
pb.Cls
pb.ScaleWidth = 100
pb.DrawMode = 10
num$ = Format$(percent, "###") + "%"
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh
End Sub
|