Solved

How do i stop flickering graphics

Posted on 1998-09-08
6
195 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:emidiod
6 Comments
 
LVL 2

Expert Comment

by:VBDesigns
ID: 1433615
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
0
 

Author Comment

by:emidiod
ID: 1433616
Thanks, i tried it, but it the background still flickers through before loading the picture box
0
 
LVL 14

Expert Comment

by:waty
ID: 1433617
Hide the picture when you load the bitmap. Show it when all is loaded.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:emidiod
ID: 1433618
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
0
 

Expert Comment

by:jfayling
ID: 1433619
I sure you already did this, but I guess I have to ask.  Have you set the autoredraw property of the picturebox to true?
0
 
LVL 2

Accepted Solution

by:
AllenC_Jr earned 70 total points
ID: 1433620
What Pictures are You Loading into the Picture Boxes? If they are gif's then that is your problem, gif's have that problem with flickering. If you are not using a transparent background then do this(if you are loading the pictures)

pic1.AutoRedraw=True
Pic1.PaintPicture LoadLicture(Filename)
pic1.AutoRedraw=False

Or if the pics are already loaded do this

pic1.AutoRedraw=True
Pic1.PaintPicture Pic1
pic1.AutoRedraw=False
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Acccess - Update Field in Table when report is printed 6 47
Access query that references subform 5 47
message box in access 4 51
How to make an ADE file by code? 11 94
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

820 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