MFC : How to add tooltip in Cmenu items?

本小妞迷上赌 提交于 2019-12-01 17:09:03

问题


How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks...


回答1:


The easiest way is to pass multiple strings to the Menu text separated by newline characters.

This will automagically make CMenu display the second part of the text as the menu tooltip.

e.g., If a menu item text is "Click here", change it to

"Click here\nThis is the tooltip for the menu item ..."

Of course, if you like more advanced/fancy tooltips, then try

http://www.tooltips.net/downloads.html

Its easy to implement, and the output is very cool




回答2:


Tooltips for Menu Item and popup menuitem - CodeProject

http://www.codeproject.com/KB/menus/menuitemtooltip.aspx

Tooltips for Menu Items and Popup Menu Items - CodeGuru

http://www.codeguru.com/cpp/controls/controls/tooltipcontrols/article.php/c5233




回答3:


I can't vouch for whether this sample works, but the strategy of handling WM_MENUSELECT is sound:

http://msdn.microsoft.com/en-us/magazine/cc164067.aspx



来源:https://stackoverflow.com/questions/2400180/mfc-how-to-add-tooltip-in-cmenu-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!