Solved

CStatic and SetBitmap

Posted on 1998-09-09
2
894 Views
Last Modified: 2013-11-20
Hi,

I'm trying to make a dialog just like the one you get when you insert the Visual Studio disc into the CD driver

I'm using CStatic for "button" which is actually only a bitmap.
I'm using OnMouseMove and can recognize if the mouse pointer is on a "button" or not and if it is, I'm using SetBitmap to change
the "button's" bitmap.

The problem is that some times, not always !, there change between the bitmaps is not smooth and there is a flickering effect.

My questin is, can I avoid this ??

Thanks in advance

Israel
0
Comment
Question by:israel022697
2 Comments
 
LVL 2

Accepted Solution

by:
prasanth earned 50 total points
ID: 1321972
Try using a CBitmapButton instead.
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1321973
Just using CBitmapButton won't completely help you.  It will only let you define focus/non-focus/down/disabled bitmaps, but they are relatively flicker free.  

The only way to use a CBitmapButton is to physically change the button from a 'up' bitmap to a 'focus' bitmap when moved over.

Now the trick is to override the CBitmapButton and replace it with your own function.  When you move the mouse over a button, you'll want to delete the old bitmap image and load up the new image.  Take a look at the CBitmapButton source code and you'll see that all you have to do.  A quickie rememberance is take the 'up' bitmap, do a DeleteObject on it, load it back up with a LoadBitmap, and the button should update itself 'hopefully' cleanly.  

I have some code up at work that will help you, but I'm not there right now.

Phillip
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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