问题
I use Borland C++ Builder 2009 and when a large font is used, the Menu items in MainMenu and Popup are too close to each other, text cut off on top and bottom even, when too big.
I understand I can change the height of the items with TMenuItem.OnMeasureItem
but to what height should I set it ?
What's the best way to calculate an ideal height and how do I get the variables for it (e.g. height of text)?
回答1:
OnMeasureItem
handlers suggests you default value in Height
var parameter.
You can multiply this value by ratio of current screen PPI and default PPI for font size 100% (96), e.g. Height := Ceil(Height * Screen.PixelsPerInch / 96);
来源:https://stackoverflow.com/questions/34324974/determine-height-of-text-in-tmenuitem-to-decide-to-what-height-to-change-the-men