W
Wal Turner
My general question is:
How does one determine the font of a System.Windows.Form.MenuItem?
I have a custom MenuItem where I have set OwnerDraw = true, and hence the
implementations of DrawItem and MeasureItem.
With a menuitem, there is nothing like menuItem.Font to get the current
Font. This is causing a problem when coding MeasureItem as I don't know how
wide the menu item is supposed to be:
e.ItemWidth = (int)e.Graphics.MeasureString(menu.Text,
<FONT_ARG_HERE).Width;
When coding DrawItem its OK because we have a DrawItemEventArgs which has a
Font as a property.
Regards
Wal
How does one determine the font of a System.Windows.Form.MenuItem?
I have a custom MenuItem where I have set OwnerDraw = true, and hence the
implementations of DrawItem and MeasureItem.
With a menuitem, there is nothing like menuItem.Font to get the current
Font. This is causing a problem when coding MeasureItem as I don't know how
wide the menu item is supposed to be:
e.ItemWidth = (int)e.Graphics.MeasureString(menu.Text,
<FONT_ARG_HERE).Width;
When coding DrawItem its OK because we have a DrawItemEventArgs which has a
Font as a property.
Regards
Wal