如何更改 CDialog 图标以响应鼠标悬停?
如何更改鼠标悬停时的应用程序图标?我想在 CDialog 的系统菜单中放置一些菜单项,并且希望当用户将鼠标悬停在其上时图标突出显示,以表明它是一个用户界面组件(类似于最新版本的 firefox 在橙色,当您将鼠标悬停在它上面时,它会突出显示)。
更新
“应用程序图标”是指系统菜单图标。另外,我刚刚遇到了 CMFCRibbonApplicationButton 类,它虽然不是系统菜单,但看起来也很有前途。
How can I change the application icon on mouseover? I want to put some menu items in the system menu of my CDialog, and I want the icon to highlight when the user mouses over it to indicate that it is a user interface component (similar to how recent versions of firefox have the firefox menu in orange and when you mouseover it, it highlights).
UPDATE
By "application icon" I mean the system menu icon. Also I just came across the CMFCRibbonApplicationButton class which, while not the system menu, also looks promising.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 WM_NCHITTEST
HTSYSMENU
代码,然后调用 设置图标。Check WM_NCHITTEST for
HTSYSMENU
code and then call SetIcon.有实现MouseOverEvent的代码: http://www.codeproject.com/KB/cpp /mouseenterleave.aspx 当您捕获该事件时,您可以做任何您喜欢的事情。
There is the code to implement MouseOverEvent: http://www.codeproject.com/KB/cpp/mouseenterleave.aspx When you catch the event you can do whatever you like.