I'm using VS 2008, and I would like to add a contextMenu (definitely not ContextMenuStrip
!!) to my application. There is no contextMenu (!!) in the toolbox. So how can I add it programmatically to my code?
Thanks In Advance,
I assume you use Winforms, you can initialize ContextMenu
class in your code. It has a 2 constructor which you can pass MenuItem
as a parameter.
ContextMenu cm = new ContextMenu();
or
ContextMenu cm1 = new ContextMenu(new MenuItem[]);