Solved

CStatic and SetBitmap

Posted on 1998-09-09
2
899 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 134
Replacement selected text 2 65
Sed question 2 122
JQuery serialize and unserialize 8 185
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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