dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: VB5,VB6
Expertise: beginner
Apr 7, 2001

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


MoveProgressBarIntoPanel - Move a ProgressBar inside a StatusBar's panel

' Move and resize a ProgressBar control so that it fits inside
' a StatusBar's Panel.
'
' The last argument is the panel index (one-based).

Sub MoveProgressBarIntoPanel(pb As ProgressBar, sb As StatusBar, _
    pnlIndex As Integer)
    Dim deltaY As Single, pnl As Panel, y As Single
    
    ' account for two pixels around each panel
    deltaY = pb.Parent.ScaleY(2, vbPixels, vbTwips)
    Set pnl = sb.Panels(pnlIndex)
    pnl.Bevel = sbrNoBevel
    ' It is necessary to evaluate the Y coordinate in this way because
    ' if this routine is invoked from Form_Resize you can't rely on
    ' the StatusBar's or Panel's Top property, which still has to be updated.
    y = pb.Parent.ScaleHeight - sb.Height
    
    ' Move the progress bar in position, and in front of the status bar.
    pb.Move pnl.Left, y + deltaY, pnl.Width, sb.Height - deltaY
    pb.Visible = True
    pb.ZOrder
End Sub
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date