本文介绍了MFC CMenu工具提示未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用类似的方法来设置CMenu项的工具提示(如),但它仅显示在一行中,并且看不到换行符.
I tried using something like this to set the tool tip of a CMenu item (as described here) but it is just being displayed in a single line and the line break is not visible.
// read control id
UINT id = menu->GetMenuItemID(1235);
// modify caption and add tooltip?
menu->ModifyMenu( id, MF_BYCOMMAND, id, "Click here\nThis is the tooltip for the menu item ...");
我还尝试直接在菜单项的Visual Studio资源设计器中设置标题,效果相同.你能给我什么提示吗?我在Windows 7上使用VS2008.
I also tried to set the caption directly in the visual studio resource designer of the menu item with the same effect.Can you give me any hints on whats wrong? I am using VS2008 on windows 7.
感谢您的帮助!
推荐答案
主要应该使用\ r \ n而不是\ n,因为这是mfc期望的.
Mainly you should use \r\n instead of \n because this is what mfc expects.
这篇关于MFC CMenu工具提示未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!