|
-
Feb 2nd, 2004, 09:00 PM
#1
Thread Starter
Frenzied Member
[VB] Progress bar
'Use with a picturebox
'Forecolor of picturebox = the progress color
'
'
Public Function UpdateProgress(pb As Control, ByVal Percent As Integer, Optional ByVal ShowPercent = False)
On Error Resume Next
Dim Num As String
If Not pb.AutoRedraw Then
pb.AutoRedraw = -1
End If
pb.Cls
pb.ScaleWidth = 100
If ShowPercent = True Then
Num$ = Format$(Percent, "###0") + "%"
pb.CurrentX = 50 - pb.TextWidth(Num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(Num$)) / 2
pb.Print Num$ 'print percent
End If
pb.Line (0, 0)-(Percent, pb.ScaleHeight), , BF
pb.Refresh 'show differents
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|