Pergunta

I'm relatively new to programming and my problem is with a TMainMenu on my form. I researched a lot
(a whole lot) of sites for a solution, but haven't found any that solves this exact problem.
The main menu won't resize, not even when I change the fontsize using Screen.MenuFont.Size.
I tried setting the Height property in the OnMeasureItem handler, I tried resizing the images and sub-menuitems at both design- and runtime, I even tried capturing Windows' message WMDrawItem and changing it's parameter before passing it on...

The menu items in the component are resized accordingly, but the vertical height of the menubar itself isn't. (the line seen on the picture below cutting through the icons)

Is there an easy solution to this, like setting some well hidden height property somewhere?
Or do I have to rewrite half of delphi's code to achieve my goal?
Help with code examples are appreciated. :-)

Here's an image: enter image description here

I am using Delphi 7 on a Win7 machine.

Foi útil?

Solução

I would recommend to use TActionMainMenuBar instead. It is much more flexible then the TMainMenu. You can change the font of the menu bar very easy as well.

Outras dicas

The height of the menu bar is a Windows metric setting. Thus it is valid system wide - not only for your application. If at all, it can only be changed via the display settings of Windows itself.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top