'Windows 11 Context Menu Style

Default styles offered for the Windows Forms context menu control (using ContextMenuStrip) are looking like something that was created for Office XP - its styling doesn't quite match that of Windows 11.

Example of an old context menu in Windows 11

For contrast, a modern Windows 11 context menu has rounded corners and is theme-aware:

Theme-aware Windows 11 context menu

Even for cases where it is not theme-aware for some legacy applications, it's still using rounded corners.

Example of modern Windows 11 context menu

How can I replicate the theme-aware style and the modern (rounded corner) context menu for a Windows 11 tray icon from a Windows Forms (or Console) application?

Ideally, I am trying not to write a whole tray menu renderer from scratch and instead just re-use built-in OS components, but so far I am running into a wall when it comes to figuring out what tooling I need to use to even get the menu.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source