Solved

How do i stop flickering graphics

Posted on 1998-09-08
6
185 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA Check for Character 9 72
VB error "Type mismatch" 2 43
Adding to a VBA? 6 49
vb6 connector to mongodb 2 31
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

746 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

9 Experts available now in Live!

Get 1:1 Help Now