Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mimic .NET Marquee Style ProgressBar in VBA????

Status
Not open for further replies.

westchamp24

Programmer
Aug 15, 2008
1
0
0
US
Hello everyone,

I am trying to display a very elementary progress bar for a VBA application. Basically, I am looking to mimic the marquee style progress bar available in .NET. Simply put I just want to have some type of animation while the program is running; I am not looking to use steps. Any suggestions
 
Here's one possible method. You'll need a userform with two Images on it and a command button:
Code:
[blue]Option Explicit

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub CommandButton1_Click()
    Dim lp As Long
    For lp = 0 To 100
        Progressbar lp
        DoEvents
        Sleep 100
    Next
End Sub

Private Sub Progressbar(Percent As Variant)
    Image2.BackColor = RGB(0, 0, 255)
    With Image1
        Image2.Move .Left, .Top, .Width * Percent / 100, .Height
    End With
End Sub[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top