I have developed a Winform MDI application, in which client specifically requires a context menu which is shown throughout the applicaton. The context menu has two items viz. Calculator and Exit.
If I were him I would have kept two menuitems in MDI Menubar, but its the crazy requirement of client so I have to fulfill it.
What I tried is creating a ContextMenu in the MainForm, making it public which I can access from all the child forms using static Instance of MainForm. Another option is to inject the contextmenu via constructor. But I wonder if there is some better way to do it.
I hope I am clear. Thank you for your time.
Regards 🙂
It was much simpler than i thought, I just assigned the context menu strip to MDI Form and its available for all child forms, unless we explicitly declare a different menu strip for the children forms.