如何设置WTL :: CMenu的最小宽度 [英] How to set minimum width for WTL::CMenu

查看:146
本文介绍了如何设置WTL :: CMenu的最小宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我有一个按钮,单击它会显示弹出WTL :: CMenu.

菜单的宽度会根据最长菜单项的宽度自动更改.

但是,如果最大的项(在菜单下拉列表中)的宽度小于按钮的宽度,则菜单看起来很难看.

所以我想为弹出菜单设置最小宽度(自动保留最大宽度)

谁能帮助我做到这一点?

在此先感谢!

Hi all!

I have a button, clicking on which displays the popup WTL::CMenu.

The width of menu is automatically changed based on the width of the longest menu item.

But if the largest item''s (in menu drop-down list) width is smaller than button''s width the menu looks ugly.

So I''d like to set the minimum width for popup menu (leaving the maximum width automatic)

Can anyone help me to do that?

Thanks in advance!

推荐答案


实现目标的最简单方法是在最短菜单项的末尾添加一个制表符或一些空格.
否则,您可以使用所有者绘制的菜单项;菜单所有者窗口应从WTL::COwnerDraw<>. 派生. atluser.h 中的WTL::CMenuT<>WTL::CMenuItemInfo类可以为您提供帮助.
欢呼声,
AR
Hi,
The simplest way to achieve your goal is to add a tab or some spaces at the end of your shortest menu item.
Otherwise you can use an Owner-Drawn menu item; the menu owner window should derive from WTL::COwnerDraw<>. The WTL::CMenuT<> and WTL::CMenuItemInfo classes in atluser.h can help you.
cheers,
AR


这篇关于如何设置WTL :: CMenu的最小宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆