problem with a progressbar : it dispears

  • 9 years ago

     

    I have  two userforms .One is  a progressbar  that I made. The other  is  a userform that   contains a   long code.The  progressbar allows the user  to see  the percentage of the execution.   My problem  is the progressbar dispears each step of the execution  of  the principal code. How can I maintain  the progressbar until  the end of the execution.

  • 9 years ago
    I did some testing and the following worked without too much delay: frmProgressBar.Visible = True Me.Hide For i = 1 To 1000000 frmProgressBar.ProgressBar1.Value = i / 10000 DoEvents Next i Me.Visible = True If I did a frmProgressBar.Refresh inside the loop, or even a frmProgressBar.ProgressBar1.Refresh, it slowed the loop down, but if you have a massive amount of code going on, the performance hit may be acceptable. Hope this helps!

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan