Gets or sets the main automation context menu.
Syntax
Visual Basic (Declaration) | |
---|
Public Property ContextMenu As ContextMenu |
Return Value
The main automation context menu
Example
This example adds a "Test" menu item to the main automation context menu.
Visual Basic | Copy Code |
---|
Public Sub AnnAutomationManager_ContextMenu(ByVal manager As AnnAutomationManager)
Dim cm As ContextMenu = manager.ContextMenu
cm.MenuItems.Add("-")
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
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also