Solution found here: How can I customize the system menu of a Windows Form?. Anyway, thanks for your help :)
I want to add a new item to the default contextmenu of a form, which appears when right clicked on the top bar (where the minimize box and maximize box are).
I'd also prefer to to it programatically (not in the designer)
I've tried this
public Form1()
{
InitializeComponent();
this.ContextMenu.Add(new MenuItem("Test")); //->NullReferenceException
this.ContextMenu = new ContextMenu(/*..*/); //-> Not what I want
}
which leads to a NullReferenceException.
if I set this.ContextMenu
it affects only the contextmenu that appears when you right click into the form, which I don't need in this case.
I hope someone can help me out ^^ I know it needs to be possible somehow since I've seen it in a lot of Programs already