Click here to Skip to main content
15,883,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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!
Posted

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900