mfcvisual-c++tooltipcmenu

MFC : How to add tooltip in Cmenu items?


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


Solution

  • 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 Tooltips.NET

    Its easy to implement, and the output is very cool