-
September 20th, 2012, 12:26 AM
#1
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.
Any suggestions?
-
September 20th, 2012, 12:59 AM
#2
Re: Vertical spacing on a CMenu
You could change it using owner draw menu.
Victor Nijegorodov
-
September 20th, 2012, 01:06 AM
#3
Re: Vertical spacing on a CMenu
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.
-
September 20th, 2012, 07:29 AM
#4
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.
-
September 21st, 2012, 03:37 AM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|