Right click menu under winforms
Put a ContextMenuStrip
on your form, design your menu, then set the ContextMenuStrip
property on the form to the component created.
Add a System.Windows.Forms.ContextMenuStrip
item to the form, then set the form's ContextMenuStrip
property.
After putting a ContextMenuStrip
on your form, Add it to your Control
(you can do it in Control
's Properties) and then , use code like this for showing menu:
private void myTree_MouseClick(object sender, MouseEventArgs e)
{
myTree.ContextMenu.Show(myTree, new Point(e.X, e.Y));
}
more on MSDN.