I don't think the progress bar can be moved. However, it is simple to create your own for display on a form. Either use an ActiveX control (such as contained within Microsoft Windows Common Controls 6.0 as supplied with VB6), or better still make your own out of two labels.
I create two labels, one of which is the 'outer', the other the 'inner'. I set the outer label to have a border, but with transparent fill so the 'inner' label can be seen through it. This is the label that displays the progress percentage text. The inner label is the actual progress bar, and I set the width to a proportion of the outer label width according to how far we have progressed.
Private Sub ShowProgress(RCount As Long, TotalCount As Long)
'RCount is how many we have done so far
'TotalCount is how many for the whole job
Dim NewWidth As Single
If TotalCount = 0 Then 'Quick way to reset the bar, by passing total of zero
NewWidth = 0
lblProgressOuter.Caption = ""
Else
NewWidth = lblProgressOuter.Width * (RCount / TotalCount)
lblProgressOuter.Caption = CLng((RCount / TotalCount) * 100) & "%"
End If
lblProgressInner.Width = NewWidth
End Sub
You can change the two labels' Visible properties when you want to 'switch' them off and on again.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.