LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

ContextMenu Property (AnnAutomationManager)

Example 





Gets or sets the main automation context menu.
Syntax
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 ContextMenu ContextMenu {get; set;}
 get_ContextMenu();
set_ContextMenu(value);
public:
property ContextMenu^ ContextMenu {
   ContextMenu^ get();
   void set (    ContextMenu^ value);
}

Property Value

The main automation context menu
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 System.Windows.Forms.ContextMenu derived class if desired.
Example
 
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
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");
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnAutomationManager Class
AnnAutomationManager Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.