• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

How do you stop a progress bar flickering

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
visualbasic
Asked:
visualbasic
  • 2
  • 2
1 Solution
 
Mikal613Commented:
add Do Events in your loop
0
 
plqCommented:
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
 
plqCommented:
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
 
Mikal613Commented:
That wouldnt do it
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now