Tools Links Login

Place a Progress Bar in a Status Bar

Places a Progress Bar in a Status Bar, with Windows Common Controls 6, without any third party OCXs or API.

Original Author: xsteinberger

Assumptions

The progress bar must have it's Appearance property set to 0-ccFlat and its BorderStyle set to 0-ccNone, it may be located anywhere on the form.

Code

Private Sub Form_Paint()
Dim WidthOfBorder As Single
ScaleMode = vbTwips
WidthOfBorder = (Width - ScaleWidth) / 4

'assuming the progress bar is named ProgressBar1 and the status bar named StatusBar1, and placing the progress bar in panel 2
'moving the progressbar to the statusbar and adjusting size
ProgressBar1.Move StatusBar1.Panels(2).Left + 30, _
StatusBar1.Top + WidthOfBorder + 20, _
StatusBar1.Panels(2).Width - 50, _
StatusBar1.Height - WidthOfBorder - 30
'the values are hardcoded to allow the border to display to make the progressbar appear 3d and look smart. the progressbar may be hidden and replaced with text normally using the .panels().text property of the statusbar, as the progressbar is not actually in the statusbar, merely hovering above.
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 95 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.