Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.2
|
Leadtools.Annotations Namespace > AnnAutomationManager Class : ContextMenu Property |
public ContextMenu ContextMenu {get; set;}
'Declaration Public Property ContextMenu As ContextMenu
'Usage Dim instance As AnnAutomationManager Dim value As ContextMenu instance.ContextMenu = value value = instance.ContextMenu
public: property ContextMenu^ ContextMenu { ContextMenu^ get(); void set ( ContextMenu^ value); }
This example adds a "Test" menu item to the main automation context menu.
Imports Leadtools Imports Leadtools.Annotations Imports Leadtools.WinForms Imports Leadtools.Codecs Public Sub AnnAutomationManager_ContextMenu(ByVal manager As AnnAutomationManager) Dim cm As ContextMenu = manager.ContextMenu ' add a separator cm.MenuItems.Add("-") ' add a test menu item cm.MenuItems.Add("Test", New EventHandler(AddressOf MyTestMenuItemHandler)) End Sub Private Sub MyTestMenuItemHandler(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show("Test clicked") End Sub
using Leadtools; using Leadtools.Annotations; using Leadtools.WinForms; using Leadtools.Codecs; public void AnnAutomationManager_ContextMenu(AnnAutomationManager manager) { ContextMenu cm = manager.ContextMenu; // add a separator cm.MenuItems.Add("-"); // add a test menu item cm.MenuItems.Add("Test", new EventHandler(MyTestMenuItemHandler)); } private void MyTestMenuItemHandler(object sender, EventArgs e) { MessageBox.Show("Test clicked"); }