[ToolboxItem(false)] [DesignTimeVisible(false)] [DefaultEvent("Popup")] [ToolboxItemFilter("System.Windows.Forms")] [ListBindable(false)] [DesignerCategory("Component")] public class GoContextMenu : System.Windows.Forms.ContextMenu
ContextMenu
that provides an easy way to get the GoView in which a context menu MenuItem.Click
event handler was invoked.[ToolboxItem(false)] [DesignTimeVisible(false)] [DefaultEvent("Popup")] [ToolboxItemFilter("System.Windows.Forms")] [ListBindable(false)] [DesignerCategory("Component")] public class GoContextMenu : System.Windows.Forms.ContextMenu
public override GoContextMenu GetContextMenu(GoView view) { GoContextMenu cm = new GoContextMenu(view); cm.MenuItems.Add(new MenuItem("Copy", new EventHandler(this.Copy_Command))); return cm; } private void Copy_Command(Object sender, EventArgs e) { GoView v = GoContextMenu.FindView(sender as MenuItem); if (v != null) v.EditCopy(); }