Progress Bar Non-OCX
Fill the progressbar up to the percent given.
Assumes
You need to add the PictureBox to a form and that's about it.
Returns
Progressbar value.
Rate Progress Bar Non-OCX
(2(2 Vote))
'Visit: http://slikk.emunx.net/ or http://slikk.emunx.net/forum and support our site, we just got it up and running and we need visitors, thanks.
Public Sub UpdateProgress(pBar As PictureBox, Percent As Single, Optional ByVal ShowPercent = False)
Dim sData As String
If Not pBar.AutoRedraw Then '//no memory?
pBar.AutoRedraw = -1 'nope, we make some
End If
pBar.Cls '//clear memory
pBar.ScaleWidth = 100 'set scale's width
pBar.DrawMode = 10 '//set draw modus
If ShowPercent = True Then
sData$ = Format(Percent, "###0") + "%" '//format percent
pBar.CurrentX = 50 - pBar.TextWidth(sData$) 'set the currentX for the progress
pBar.CurrentY = pBar.ScaleHeight - pBar.TextHeight(sData$) 'set the currentY for the progress
Debug.Print sData$ 'show percent in debug window
End If
pBar.Line (0, 0)-(Percent, pBar.ScaleHeight), , BF
pBar.Refresh
End Sub
'Call UpdateProgress (Picture1, 50, False)
Progress Bar Non-OCX Comments
No comments yet — be the first to post one!
Post a Comment