Cancels the operation currently being performed in this
AnnAutomation
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable Sub Cancel() |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
instance.Cancel()
|
C# | |
---|
public virtual void Cancel() |
C++/CLI | |
---|
public:
virtual void Cancel(); |
Example
This example cancels the drawing of new objects when the mouse is over a certain area on the viewer.
Visual Basic | Copy Code |
---|
Public Sub AnnAutomation_Cancel()
AddHandler _automation.Viewer.MouseMove, AddressOf viewer_MouseMove
End Sub
Private Sub viewer_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
If Not _automation.CurrentDesigner Is Nothing AndAlso TypeOf _automation.CurrentDesigner Is AnnDrawDesigner Then
Dim rc As Rectangle = New Rectangle(100, 100, 100, 100)
If rc.Contains(e.X, e.Y) Then
_automation.Cancel()
End If
End If
End Sub |
C# | Copy Code |
---|
public void AnnAutomation_Cancel() { // subclass to the viewer mouse move event // _automation is an AnnAutomation object _automation.Viewer.MouseMove += new MouseEventHandler(viewer_MouseMove); } private void viewer_MouseMove(object sender, MouseEventArgs e) { // check if we have a draw designer currently selected if (_automation.CurrentDesigner != null && _automation.CurrentDesigner is AnnDrawDesigner) { // check if we are over the rectangle 100,100 to 200,200 Rectangle rc = new Rectangle(100, 100, 100, 100); if(rc.Contains(e.X, e.Y)) _automation.Cancel(); } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also