Solved

Hot buttons

Posted on 1998-05-06
3
194 Views
Last Modified: 2013-11-20
I recently created a series of buttons derived from CBitmapButton and assigned custom bitmaps to handle up, down, hot and disabled states. But it seems that the hot one does not work properly. Maybe I missed something ?
0
Comment
Question by:fmichaud061597
  • 2
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1308028
What exactly doesn't work properly?
0
 

Author Comment

by:fmichaud061597
ID: 1308029
When my mouse pointer go over my buttons, nothing happens. Normally it is supposed to display my hot bitmap.
0
 
LVL 7

Accepted Solution

by:
galkin earned 20 total points
ID: 1308030
Cbitmapbutton contains 4 bitmaps. One is for normal, "up" state when button doesn't have focus. Two is when button has focus. Three is when button is pushed. Four is for disabled state. When you move mouse pointer over the button button state doesn't change so that bitmap is not changed. Focus can be moved to the button using TAB key. If you want to change button bitmap you need to handle WM_MOUSEMOVE message, set capture when first WM_MOUSEMOVE is received change bitmap. Then when mouse pointer has left button you should release capture, restore button bitmap. You can also take advantage from _TrackMouseEvent function that would notify you when mouse pointer enters and leaves button.

0

Featured Post

What Security Threats Are You Missing?

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.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video discusses moving either the default database or any database to a new volume.

744 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