Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tool Tips

Status
Not open for further replies.

tpremore

Technical User
Apr 13, 2001
22
0
0
US
How can I add a tool tip to a button on a dialog box?
(you know, the little popup text when the mouse hovers over
the button) It seems like this should be pretty easy to do, but I'm at a loss.
Any help is appreciated
 
The best discussion I have seen came from The MFC Answer Book by Eugene Kain. If you can find a copy of that book you'll probably have your problem solved in 20 minutes. I'd copy his answer here but I'd probably be breaking all sorts of copyright laws.

A pretty decent reference is:

Beyond that, you could also try going to CodeGuru:

And if you go to msdn.microsoft.com and search for CToolTipCtrl you'll probably find lots of info.
 
It is not quite easy to do. Actually I advise you to make a derived class for your buttons.

Principal steps:
1. call EnableTooltips(TRUE) on the CButton derived class member or in the InitDialog.
2. associate a string in the string table with the SAME Id like the id of your button
3. write (by hand) a notification for the TTN_NEEDTEXT message and in the function associated with the handle put the message in the NMHDR structure.

Read the MSDN article:
"DOC: How to Display Tool Tips After Calling EnableToolTips"

Hope this helps,
s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top