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




Gets or sets the location of the auto-scroll position.

Syntax

Visual Basic (Declaration) 
Public Overridable Property ScrollPosition As Point
Visual Basic (Usage)Copy Code
Dim instance As RasterImageViewer
Dim value As Point
 
instance.ScrollPosition = value
 
value = instance.ScrollPosition
C# 
public virtual Point ScrollPosition {get; set;}
Managed Extensions for C++ 
public: __property virtual Point get_ScrollPosition();
public: __property virtual void set_ScrollPosition( 
   Point value
);
C++/CLI 
public:
virtual property Point ScrollPosition {
   Point get();
   void set (Point value);
}

Return Value

A Point object that represents the auto-scroll position in pixels.

Example

This displays the scroll positions after each zoom

Visual BasicCopy Code
Private Sub viewer_ScrollViewer(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("ScrollPosition: {0}", viewer.ScrollPosition)
   Console.WriteLine(s)
End Sub
Public Sub RasterImageViewer_ScrollViewer(ByVal viewer As RasterImageViewer)
   AddHandler viewer.ScrollViewer, AddressOf viewer_ScrollViewer

   MessageBox.Show("Scroll the image and the 'ScrollViewer' event gets fired")
   ' or do something in code to cause a scroll
End Sub
C#Copy Code
private void viewer_ScrollViewer(object sender, EventArgs e) 

   RasterImageViewer viewer = sender as RasterImageViewer; 
   string s = string.Format("ScrollPosition: {0}", viewer.ScrollPosition); 
   Console.WriteLine(s); 

public void RasterImageViewer_ScrollViewer(RasterImageViewer viewer) 

   viewer.ScrollViewer += new EventHandler(viewer_ScrollViewer); 
 
   MessageBox.Show("Scroll the image and the 'ScrollViewer' event gets fired"); 
   // or do something in code to cause a scroll 
}

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