Link to home
Start Free TrialLog in
Avatar of msali
msali

asked on

Flikering problem in labels & Images

Hi experts,
I am making a progress bar OCX with my custome properties and methods and image.

Now everything is done but when I update the value to be displayed it flickers like anything... I have also added a custom image that even a user can provide to display an image of their choice ..

Even that flickers like anything while updating.

I am almost done with my project but unfortunatelly this flickering problem is delaying my delivery.

Thanks for your help.
msali.
Avatar of Sethi
Sethi
Flag of India image

Use LockWindowUpdate API before and after the processing starts:

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

Pass the Hwnd of the windows where the processing is going to start just before the code where processing starts like:
LockWindowUpdate Me.Hwnd

Just aftre the last line of code pass 0 as value:
LockWindowUpdate 0
Avatar of msali
msali

ASKER

Hi,
I have already tried it but when I use this API and test my app my Progress bar does not move till I move my form and then it shows 100% done.  If I use DoEvents with this API the flickering starts again.

If Use this API and put 2 instances of my control on the form.. the whole screen goes buzark and starts acting funny and starts blinking....

Check if this progress bar helps you:
http://www.freevbcode.com/ShowCode.Asp?ID=1841
Avatar of msali

ASKER

Yes I have seen this progress bar.. but please my question is not regarding Progress bar it is about flickering.....

thanks a lot.
I am not trying to deviate from topic. I am just trying to help the other way.
Avatar of msali

ASKER

Hi,
After waiting for some time and doing my own research I have finally found a solution.

Thanks for your support.

I hope you would not mind if I ask my community support to delete this quesiton.

Waiting for your acknowledgment.

Thanks again.
Not at all, if you can share the solution. that would help lot many users who navigate to this thread
ASKER CERTIFIED SOLUTION
Avatar of msali
msali

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice, solution. Thanks for sharing the knowledge.
Please post a comment in CS that you intend to get the refund back but the question to be put in PAQ
Question is PAQed and 250 points refunded.

YensidMod
Experts Exchange Moderator