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

ScrollPosition Property

Example 





Gets or sets the location of the auto-scroll position.
Syntax
public virtual Point ScrollPosition {get; set;}
'Declaration
 
Public Overridable Property ScrollPosition As Point
'Usage
 
Dim instance As RasterImageViewer
Dim value As Point
 
instance.ScrollPosition = value
 
value = instance.ScrollPosition
public virtual Point ScrollPosition {get; set;}
 get_ScrollPosition();
set_ScrollPosition(value);
public:
virtual property Point ScrollPosition {
   Point get();
   void set (    Point value);
}

Property Value

A Point object that represents the auto-scroll position in pixels.
Example
 
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
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: 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.