LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

IsInteractiveModeBusy Property

Example 





Determines if the control is currently performing an interactive operation.
Syntax
[BrowsableAttribute(false)]
public virtual bool IsInteractiveModeBusy {get;}
'Declaration
 
<BrowsableAttribute(False)>
Public Overridable ReadOnly Property IsInteractiveModeBusy As Boolean
'Usage
 
Dim instance As RasterImageViewer
Dim value As Boolean
 
value = instance.IsInteractiveModeBusy
[BrowsableAttribute(false)]
public virtual bool IsInteractiveModeBusy {get;}
BrowsableAttribute()
 get_IsInteractiveModeBusy(); 
[BrowsableAttribute(false)]
public:
virtual property bool IsInteractiveModeBusy {
   bool get();
}

Property Value

true if the control is currently performing an interactive operation, false otherwise.
Remarks

The type of interactive user operation is determined by the InteractiveMode property.

Example
 
Private Sub MyRasterViewerRectangleEventHandler(ByVal sender As Object, ByVal e As RasterViewerRectangleEventArgs)
   Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
   Dim ee As RasterViewerRectangleEventArgs = New RasterViewerRectangleEventArgs(e.Status, e.Rectangle)
   If ((e.Rectangle.Left > e.Rectangle.Right) OrElse (e.Rectangle.Top > e.Rectangle.Bottom)) AndAlso e.Status = RasterViewerInteractiveStatus.End Then
      e.Cancel = True
      viewer.Invalidate()
      If (Not viewer.IsInteractiveModeBusy) Then
         MessageBox.Show("Interactive mode (Rectangular region) cancelled")
         viewer.InteractiveMode = RasterViewerInteractiveMode.None
      End If
   End If
   Console.WriteLine("" & e.Rectangle.Left & ", " & e.Rectangle.Top & ", " & e.Rectangle.Right & ", " & e.Rectangle.Bottom)
End Sub

Public Sub RasterImageViewer_IsInteractiveModeBusy(ByVal viewer As RasterImageViewer)
   AddHandler viewer.InteractiveRegionRectangle, AddressOf MyRasterViewerRectangleEventHandler
   viewer.InteractiveMode = RasterViewerInteractiveMode.Region
   viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Rectangle

   MessageBox.Show("Interactive mode set to draw a rectangular region." & Constants.vbLf & "If mouse is dragged up or to the left, interactive mode is cancelled")
End Sub
private void MyRasterViewerRectangleEventHandler(object sender, RasterViewerRectangleEventArgs e)
{
   RasterImageViewer viewer = sender as RasterImageViewer;
  RasterViewerRectangleEventArgs ee = new RasterViewerRectangleEventArgs(e.Status, e.Rectangle);
  if (((e.Rectangle.Left > e.Rectangle.Right) || (e.Rectangle.Top > e.Rectangle.Bottom)) && e.Status == RasterViewerInteractiveStatus.End)
  {
     e.Cancel = true;
     viewer.Invalidate();
     if(!viewer.IsInteractiveModeBusy)
     {
        MessageBox.Show("Interactive mode (Rectangular region) cancelled");
        viewer.InteractiveMode = RasterViewerInteractiveMode.None;
     }
  }
  Console.WriteLine(@"" + e.Rectangle.Left + ", " + e.Rectangle.Top + ", " + e.Rectangle.Right + ", " + e.Rectangle.Bottom);
}

public void RasterImageViewer_IsInteractiveModeBusy(RasterImageViewer viewer)
{
   viewer.InteractiveRegionRectangle += new EventHandler<RasterViewerRectangleEventArgs>(MyRasterViewerRectangleEventHandler);
   viewer.InteractiveMode = RasterViewerInteractiveMode.Region;
   viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Rectangle;

   MessageBox.Show("Interactive mode set to draw a rectangular region.\nIf mouse is dragged up or to the left, interactive mode is cancelled");
}
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

RasterImageViewer Class
RasterImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

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