Solved

How do i stop flickering graphics

Posted on 1998-09-08
6
191 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using web browser with BING 40 119
How to read File Date Created using VB6 8 39
Excel Automation VBA 19 69
Copy a range from 1..n excel sheets to one destination sheet 2 31
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

776 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