Is it possible to change the font size used in a ContextMenu using the .NET Framework 3.5 and C# for a desktop application? It seems it's a system-wide setting, but I would like to change it only within my application.
If you are defining your own context menu via a ContextMenuStrip
in Windows Forms, use the Font property.
If you are defining your own context menu via a ContextMenu
in WPF, use the various Fontxxx properties such as FontFamily and FontSize.
You cannot change the default context menus that come with controls; those are determined by system settings. So if you want the "Copy/Cut/Paste/etc." menu with a custom font size for a WinForms TextBox
, you'll have to create a ContextMenuStrip
with the appropriate font size and assign it to the TextBox
's ContextMenuStrip property.
In WPF:
<Window.ContextMenu FontSize="36">
<!-- ... -->
</Window.ContextMenu
In WinForms:
contextMenuStrip1.Font = new System.Drawing.Font("Segoe UI", 24F);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With