VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Place a Progress Bar in a Status Bar

by xsteinberger (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

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

Assumes
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.

Rate Place a Progress Bar in a Status Bar

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

Download this snippet    Add to My Saved Code

Place a Progress Bar in a Status Bar Comments

No comments have been posted about Place a Progress Bar in a Status Bar. Why not be the first to post a comment about Place a Progress Bar in a Status Bar.

Post your comment

Subject:
Message:
0/1000 characters