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.
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.