←Select platform

ContextMenu Property

Summary

Gets or sets the main automation context menu.

Syntax

C#
VB
C++
public ContextMenu ContextMenu { get; set; } 
  
Public Property ContextMenu As ContextMenu 
public: 
property ContextMenu^ ContextMenu { 
   ContextMenu^ get(); 
   void set (    ContextMenu^ ); 
} 

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

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

C#
VB
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"); 
} 
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 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly