如何更改弹出菜单的字体大小(MFC,VC6)
我想知道是否有一种快速简便的方法来更改 PopupMenu 的高度(即,使菜单中的每一行都有增加的垂直尺寸),并更改字体大小以使用更大的字体。
您有可以做到这一点的代码示例吗?不幸的是,CMenu 没有合适的成员来设置字体大小,或者我错过了什么?我知道有很多自制菜单的样本,这些样本对于我的目的来说都太过分了。我想做的就是增加菜单项的大小。
此外,我的菜单没有主窗口,它只是一个弹出菜单(CMenu::CreatePopupMenu)。然而,大多数示例似乎都需要主窗口。
I wonder if there is a quick and easy way to change the height of a PopupMenu (i.e. so that each line in the menu has an increased vertical size), and also change the font size to use a bigger font.
Do you have any code samples that can do that? Unfortunately, CMenu does not have an appropriate member to set the font size, or am I missing something? I know there are plenty of samples for ownderdrawn menus out there, which are all overdoing for my purposes. All I want to do is increase the size if the menu items.
Besides, my Menu has no mainwindow, it's just a popupmenu (CMenu::CreatePopupMenu). Most samples seem to require a mainwindow, however.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只能通过创建所有者绘制菜单来实现。要了解这一点,我建议阅读以下内容:
This is only possible by creating owner-draw menus. To learn about that I suggest readings such as the followings: