繁体   English   中英

MFC CMenu 工具提示未显示

[英]MFC CMenu tooltip not being displayed

我尝试使用类似这样的东西来设置 CMenu 项的工具提示(如此所述),但它只是显示在一行中,并且换行符不可见。

// 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。

任何帮助表示赞赏!

看起来像重复

主要你应该使用 \r\n 而不是 \n 因为这是 mfc 所期望的。

也许您还没有将 windows xp 通用控件添加到您的应用程序中。

尝试将常用控件添加到您的 stdafx.h:

#ifdef UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM