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

ShowContextMenu Method

Example 





A System.Drawing.Point object that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the automation control.
Displays the automation context menu.
Syntax
public virtual void ShowContextMenu( 
   Point pos
)
'Declaration
 
Public Overridable Sub ShowContextMenu( _
   ByVal pos As Point _
) 
'Usage
 
Dim instance As AnnAutomation
Dim pos As Point
 
instance.ShowContextMenu(pos)
public virtual void ShowContextMenu( 
   Point pos
)
 function Leadtools.Annotations.AnnAutomation.ShowContextMenu( 
   pos 
)
public:
virtual void ShowContextMenu( 
   Point pos
) 

Parameters

pos
A System.Drawing.Point object that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the automation control.
Remarks

This method will display the context menu in AnnAutomationManager.ContextMenu. This AnnAutomation will call this method when the user right-clicks the mouse cursor anywhere in the Container surface but not on any of the objects currently in the container. You can call this method to show this context menu manually (for example, as a result from clicking on a certain menu item in your application).

If the AnnAutomationManager.ContextMenu value is null (Nothing in Visual Basic), this method will not do anything.

If a click is on an object, this AnnAutomation object will call the ShowObjectContextMenu method instead.

Call the CanShowObjectContextMenu property to determine if the AnnAutomation is currently in a state where the object context menu can be shown

Example
 
Public Sub AnnAutomation_ShowContextMenu(ByVal automation As AnnAutomation)
   ' show the context menu at the current cursor coordinates
   Dim pos As Point = Cursor.Position
   pos = automation.Viewer.PointToClient(pos)
   automation.ShowContextMenu(pos)
End Sub
public void AnnAutomation_ShowContextMenu(AnnAutomation automation)
{
   // show the context menu at the current cursor coordinates
   Point pos = Cursor.Position;
   pos = automation.Viewer.PointToClient(pos);
   automation.ShowContextMenu(pos);
}
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

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

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