1 Attachment(s)
Vertical spacing on a CMenu
I have an MDI MFC application which has a menu at the top. Nothing particularly unusual about that, but for some reason my application seems to have a vertical spacing about 30%-40% bigger than "normal" on the drop down menus (when compared with Visual Studio itself).
I've looked thru the options for CMenu, CMFCMenuBar, CMFCVisualManager, but can't seem to find anything to explain why my menu has such a large vertical spacing between options, nor how to change it.
Attachment 30353
Any suggestions?
Re: Vertical spacing on a CMenu
You could change it using owner draw menu.
Re: Vertical spacing on a CMenu
Quote:
Originally Posted by
VictorN
You could change it using owner draw menu.
I *could*, and will if I have to, but it seems to be an awful lot of work for what seems to be a small change.
When I create a new dummy MDI application, the menu spacing is normal, so it seems there must be something my application is doing/calling to make the vertical spacing larger. In the design view, my app's menu appears with normal spacing as well.
Re: Vertical spacing on a CMenu
When you create your app initially, you can select from a number of different looks, or styles for your app's appearance. I haven't messed with them much, but it's probably related to that. Look for OnApplicationLook in your CMainFrame class and see if you can change your app's style that way and see if it helps.
Re: Vertical spacing on a CMenu
I did play around with a number of different styles in the OnApplicationLook() function, but none of them seemed to affect the menu spacing.
Creating a default, dummy, MDI application thru the wizard, I can create an application with the same settings as mine, but it still has the correct menu spacing.
However, I have found a simple solution, which doesn't explain why this issue happened in the first place, but does seem to make it go away;
CMFCMenuBar::SetMenuSizes( CSize(22, 22), CMFCMenuBar::GetMenuImageSize() );
I've placed this line in my CMainFrame::OnApplicationLook() function, and it does the trick.