private void MenuCB(System.Object sender, System.EventArgs e)
{
//TO DO:
// something what you want.
}
private void LatentPopupClipActionMenu(int eventX, int eventY)
{
ContextMenuStrip menu = new ContextMenuStrip();
ToolStripLabel menuItem0 = new ToolStripLabel("Clip Actions");
ToolStripSeparator menuItem1 = new ToolStripSeparator();
ToolStripMenuItem menuItem2 = new ToolStripMenuItem("Zoom");
ToolStripMenuItem menuItem3 = new ToolStripMenuItem("Draw Clip Area");
ToolStripMenuItem menuItem4 = new ToolStripMenuItem("Clear Clip Area");
menuItem2.Click += new EventHandler(MenuCB);
menuItem3.Click += new EventHandler(MenuCB);
menuItem4.Click += new EventHandler(MenuCB);
menu.Items.AddRange(new ToolStripItem[]{
menuItem0,
menuItem1,
menuItem2,
menuItem3,
menuItem4
});
menu.Show(this.ImageBox, eventX, eventY);//this.ImageBox is a control where you want show the menu
}
|