Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.10
|
Leadtools.Windows.Annotations Namespace > AnnAutomation Class : Cancel Method |
public virtual void Cancel()
'Declaration Public Overridable Sub Cancel()
'Usage Dim instance As AnnAutomation instance.Cancel()
public: virtual void Cancel();
This example cancels the drawing of new objects when the mouse is over a certain area on the viewer.
Imports Leadtools.Windows.Controls Imports Leadtools.Windows.Annotations Private Sub AnnAutomation_Cancel() ' subclass to the viewer mouse move event ' _automation is an AnnAutomation object AddHandler _automation.Container.MouseMove, AddressOf Container_MouseMove End Sub Private Sub Container_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) ' check if we have a draw designer currently selected If Not _automation.CurrentDesigner Is Nothing AndAlso TypeOf _automation.CurrentDesigner Is AnnDrawDesigner Then ' check if we are over the rectangle 100,100 to 200,200 Dim rc As Rect = New Rect(100, 100, 100, 100) If rc.Contains(e.GetPosition(_automation.Container)) Then _automation.Cancel() End If End If End Sub
using Leadtools.Windows.Controls; using Leadtools.Windows.Annotations; using Leadtools.Demos; using Leadtools.Help; private void AnnAutomation_Cancel() { // subclass to the viewer mouse move event // _automation is an AnnAutomation object _automation.Container.MouseMove += new MouseEventHandler(Container_MouseMove); } private void Container_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 Rect rc = new Rect(100, 100, 100, 100); if(rc.Contains(e.GetPosition(_automation.Container))) _automation.Cancel(); } }
using Leadtools.Windows.Controls; using Leadtools.Windows.Annotations; using Leadtools.Examples; using Leadtools.Silverlight.Demos; private void AnnAutomation_Cancel() { // subclass to the viewer mouse move event // _automation is an AnnAutomation object _automation.Container.MouseMove += new MouseEventHandler(Container_MouseMove); } private void Container_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 Rect rc = new Rect(100, 100, 100, 100); if(rc.Contains(e.GetPosition(_automation.Container))) _automation.Cancel(); } }
Imports Leadtools.Windows.Controls Imports Leadtools.Windows.Annotations Imports Leadtools.Silverlight.Demos Private Sub AnnAutomation_Cancel() ' subclass to the viewer mouse move event ' _automation is an AnnAutomation object AddHandler _automation.Container.MouseMove, AddressOf Container_MouseMove End Sub Private Sub Container_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) ' check if we have a draw designer currently selected If Not _automation.CurrentDesigner Is Nothing AndAlso TypeOf _automation.CurrentDesigner Is AnnDrawDesigner Then ' check if we are over the rectangle 100,100 to 200,200 Dim rc As Rect = New Rect(100, 100, 100, 100) If rc.Contains(e.GetPosition(_automation.Container)) Then _automation.Cancel() End If End If End Sub