Advertisement
2002C Custom Controls/ Forms/ Menus #10296

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.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
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
Original Comments (3)
Recovered from Wayback Machine