簡體   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