Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
InteractiveMode Property
See Also  Example
Leadtools.WinForms Namespace > RasterImageViewer Class : InteractiveMode Property



Gets or sets the value that controls user interaction with the control's display.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Interactive Mode")>
<DescriptionAttribute("Select one of the interactive modes available when the user interacts with the control.")>
Public Overridable Property InteractiveMode As RasterViewerInteractiveMode
Visual Basic (Usage)Copy Code
Dim instance As RasterImageViewer
Dim value As RasterViewerInteractiveMode
 
instance.InteractiveMode = value
 
value = instance.InteractiveMode
C# 
[CategoryAttribute("Interactive Mode")]
[DescriptionAttribute("Select one of the interactive modes available when the user interacts with the control.")]
public virtual RasterViewerInteractiveMode InteractiveMode {get; set;}
C++/CLI 
[CategoryAttribute("Interactive Mode")]
[DescriptionAttribute("Select one of the interactive modes available when the user interacts with the control.")]
public:
virtual property RasterViewerInteractiveMode InteractiveMode {
   RasterViewerInteractiveMode get();
   void set (RasterViewerInteractiveMode value);
}

Return Value

The value which controls the user interaction with the control's display.

Example

This sample changes between interactive modes -- from none, to pan, to magnifying glass, to Region, and back to none.

Visual BasicCopy Code
Private Sub viewer_InteractiveModeChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
    Dim s As String = String.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString())
    MessageBox.Show(s)
End Sub
Public Sub RasterImageViewer_InteractiveMode(ByVal viewer As RasterImageViewer)
    AddHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged
    AddHandler viewer.InteractivePan, AddressOf viewer_InteractivePan

    viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Ellipse
    viewer.InteractiveRegionCombineMode = RasterRegionCombineMode.Set

    Select Case viewer.InteractiveMode
        Case RasterViewerInteractiveMode.None
            viewer.InteractiveMode = RasterViewerInteractiveMode.Pan

        Case RasterViewerInteractiveMode.Pan
            viewer.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass

        Case RasterViewerInteractiveMode.MagnifyGlass
            viewer.InteractiveMode = RasterViewerInteractiveMode.Region

        Case RasterViewerInteractiveMode.Region
            viewer.InteractiveMode = RasterViewerInteractiveMode.None
    End Select
    RemoveHandler viewer.InteractiveModeChanged, AddressOf viewer_InteractiveModeChanged
End Sub
C#Copy Code
private void viewer_InteractiveModeChanged(object sender, EventArgs e) 

   RasterImageViewer viewer = sender as RasterImageViewer; 
   string s = string.Format("InteractiveMode changed to: {0}", viewer.InteractiveMode.ToString()); 
   MessageBox.Show(s); 

public void RasterImageViewer_InteractiveMode(RasterImageViewer viewer) 

   viewer.InteractiveModeChanged += new EventHandler(viewer_InteractiveModeChanged); 
   viewer.InteractivePan += new EventHandler<RasterViewerLineEventArgs>(viewer_InteractivePan); 
 
   viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Ellipse; 
   viewer.InteractiveRegionCombineMode = RasterRegionCombineMode.Set; 
 
   switch (viewer.InteractiveMode) 
   { 
      case RasterViewerInteractiveMode.None: 
         viewer.InteractiveMode = RasterViewerInteractiveMode.Pan; 
         break; 
 
      case RasterViewerInteractiveMode.Pan: 
         viewer.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass; 
         break; 
 
      case RasterViewerInteractiveMode.MagnifyGlass: 
         viewer.InteractiveMode = RasterViewerInteractiveMode.Region; 
         break; 
 
      case RasterViewerInteractiveMode.Region: 
         viewer.InteractiveMode = RasterViewerInteractiveMode.None; 
         break; 
   } 
   viewer.InteractiveModeChanged -= new EventHandler(viewer_InteractiveModeChanged); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also