Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
ContextMenu Property
See Also  Example
Leadtools.Annotations Namespace > AnnAutomationManager Class : ContextMenu Property




Gets or sets the main automation context menu.

Syntax

Visual Basic (Declaration) 
Public Property ContextMenu As ContextMenu
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomationManager
Dim value As ContextMenu
 
instance.ContextMenu = value
 
value = instance.ContextMenu
C# 
public ContextMenu ContextMenu {get; set;}
Managed Extensions for C++ 
public: __property ContextMenu get_ContextMenu();
public: __property void set_ContextMenu( 
   ContextMenu value
);
C++/CLI 
public:
property ContextMenu ContextMenu {
   ContextMenu get();
   void set (ContextMenu value);
}

Return Value

The main automation context menu

Example

This example adds a "Test" menu item to the main automation context menu.

Visual BasicCopy Code
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
C#Copy Code
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"); 
}

Remarks

This is the menu that appears when the user clicks anywhere on a container but not on any of the objects currently in the container. You can directly manipulate this context menu or set your own ContextMenu derived class if desired.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features