Solved

change the behavior of a button....

Posted on 1998-11-16
1
187 Views
Last Modified: 2013-11-20
I would like to change the caption of a button everytime I move the mouse cursor on top of a button. Is there a way to do it??????? Many thanks.

0
Comment
Question by:stephenkong
[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
1 Comment
 
LVL 2

Accepted Solution

by:
wyy_cq earned 50 total points
ID: 1324809
add meesage map of OnSetCursor in the parent window.
afx_msg BOOL OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message );
the pWnd is the window under the point, you can get the ID of the window.
pWnd->GetDlgCtrlID() if it equal to the ID of the button,you call pWnd->SetWindowText("in_text"); to set the caption of the window(button).by this you can know when the mouse move into the range of the botton .

but how can you know the cursor is move out of the range of the button,
you need add a tag ,when the mouse move into ,you set it to be TRUE and you need not to call SetWindow("in_text") again when the tag is TRUE.
if you get the ID is not equal to the ID of the button you need to set the tag to FALSE and set button caption at the same time. at the next time you find your mouse is out of the button you will need not to set the caption again.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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
repeatEnd java challenge 42 85
Looking for a specific application/software 2 119
sumDigits challenge 9 172
canBalance challenge 34 105
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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

749 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