Link to home
Start Free TrialLog in
Avatar of emidiod
emidiod

asked on

How do i stop flickering graphics

I have 6 picturebox controls and load each of them with a command button control array.  The zorder at design time of the picture boxes is 5 to 0 and the corresponding control index is 0 to 5 connecting to the corresponding command buttons 0 to 5.  When i click command control button 0 the picturebox being loaded flickers and the background show through.  It also happens at some other points in the app.  How can i stop the flickering?
Avatar of VBDesigns
VBDesigns

Try using the LockWindowUpdate API to turn off the Window refreshing of the parent (i.e. the VB Form) for the period between the load(s) and refresh of the pictures:

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

Good luck!

Dave
Avatar of emidiod

ASKER

Thanks, i tried it, but it the background still flickers through before loading the picture box
Hide the picture when you load the bitmap. Show it when all is loaded.
Avatar of emidiod

ASKER

Thanks but I am doing that.  There seems to be a zorder problem in VB.  If i have 3 picture boxes say pic1 , pic2 and pic3 and their zorders are 2,1,0 respectively (ie pic3 is on top).  Whenever i load pic2 and pic3 everything is OK, but when i bring pic1 to the front by changing its ZORDER the form background flickers through.  Is there a solution
I sure you already did this, but I guess I have to ask.  Have you set the autoredraw property of the picturebox to true?
ASKER CERTIFIED SOLUTION
Avatar of AllenC_Jr
AllenC_Jr

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