Solved

How do i stop flickering graphics

Posted on 1998-09-08
6
187 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
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.

 

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

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

920 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

12 Experts available now in Live!

Get 1:1 Help Now