Solved

CStatic and SetBitmap

Posted on 1998-09-09
2
889 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
Comment Utility
Try using a CBitmapButton instead.
0
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

11 Experts available now in Live!

Get 1:1 Help Now