Solved

How do you stop a progress bar flickering

Posted on 2004-04-01
4
171 Views
Last Modified: 2010-05-18
How do you stop a progress bar flickering?
when I iterate through 2000 values my progress bar flickers.why does this happen? How can I prevent it?
Cheers
0
Comment
Question by:visualbasic
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 10734270
add Do Events in your loop
0
 
LVL 8

Accepted Solution

by:
plq earned 50 total points
ID: 10735939
start
    LockWindowUpdate pbr.hwnd
... do processing
    LockWindowUpdate 0&
... update pbr
    LockWindowUpdate tbr.hwnd
... do processing
    LockWindowUpdate 0&
... update pbr
    LockWindowUpdate tbr.hwnd
... do processing
    LockWindowUpdate 0&
finished


Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
0
 
LVL 8

Expert Comment

by:plq
ID: 10735954
on the other hand, maybe you're updating it every record. Only update it every 100 records

if lCount mod 100 = 0 then
   ... update pbr
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10736008
That wouldnt do it
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now