GdPicture.NET Reference Guide
SetScrollBarsPosition Method
Example 





GdPicture14.WPF Namespace > GdViewer Class : SetScrollBarsPosition Method
The new horizontal coordinate, in pixels, where the horizontal scrollbar is to be moved.
The new vertical coordinate, in pixels, where the vertical scrollbar is to be moved.
Sets the required position of both the horizontal and the vertical scrollbars in one step, in other words, both scrollbars move to the newly specified coordinates. The coordinates are expressed in pixels and they are related to the actual document area of the currently displayed page of the document displayed in the GdViewer control.
Syntax
'Declaration
 
Public Sub SetScrollBarsPosition( _
   ByVal NewHPos As Double, _
   ByVal NewVPos As Double _
) 
public void SetScrollBarsPosition( 
   double NewHPos,
   double NewVPos
)
public procedure SetScrollBarsPosition( 
    NewHPos: Double;
    NewVPos: Double
); 
public function SetScrollBarsPosition( 
   NewHPos : double,
   NewVPos : double
);
public: void SetScrollBarsPosition( 
   double NewHPos,
   double NewVPos
) 
public:
void SetScrollBarsPosition( 
   double NewHPos,
   double NewVPos
) 

Parameters

NewHPos
The new horizontal coordinate, in pixels, where the horizontal scrollbar is to be moved.
NewVPos
The new vertical coordinate, in pixels, where the vertical scrollbar is to be moved.
Remarks
Please note that if the newly specified values are out of the expected range, the toolkit sets the current values to the nearest one (means minimum or maximum ones) without reporting any error. Otherwise, you can regularly apply the GetStat method to determine if this method has been successful.

Just to remind you, that all coordinates are 0-based with the origin being in the top left corner in the document pages area and they are related to the current page determined by the CurrentPage property.

Example
How to set the scrollbar to its maximum available position to allow to display the bottom right corner of the document.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
If GdViewer1.HorizontalScrollBarVisible OrElse GdViewer1.VerticalScrollBarVisible Then
    GdViewer1.SetScrollBarsPosition(GdViewer1.GetHorizontalScrollBarMaxPosition(), GdViewer1.GetVerticalScrollBarMaxPosition())
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
if (GdViewer1.HorizontalScrollBarVisible || GdViewer1.VerticalScrollBarVisible)
    GdViewer1.SetScrollBarsPosition(GdViewer1.GetHorizontalScrollBarMaxPosition(), GdViewer1.GetVerticalScrollBarMaxPosition());
See Also

Reference

GdViewer Class
GdViewer Members
Scroll Event
SetVerticalScrollBarPosition Method
SetHorizontalScrollBarPosition Method
GetDisplayedArea Method