GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / SetHVScrollBarPosition 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.
Example





In This Topic
SetHVScrollBarPosition Method (GdViewer)
In This Topic
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 SetHVScrollBarPosition( _
   ByVal NewPosH As Integer, _
   ByVal NewPosV As Integer _
) 
public void SetHVScrollBarPosition( 
   int NewPosH,
   int NewPosV
)
public procedure SetHVScrollBarPosition( 
    NewPosH: Integer;
    NewPosV: Integer
); 
public function SetHVScrollBarPosition( 
   NewPosH : int,
   NewPosV : int
);
public: void SetHVScrollBarPosition( 
   int NewPosH,
   int NewPosV
) 
public:
void SetHVScrollBarPosition( 
   int NewPosH,
   int NewPosV
) 

Parameters

NewPosH
The new horizontal coordinate, in pixels, where the horizontal scrollbar is to be moved.
NewPosV
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.

Be aware that the ScrollViewer event is not raised at all using this method.

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.HScrollVisible OrElse GdViewer1.VScrollVisible Then
    GdViewer1.SetHVScrollBarPosition(GdViewer1.GetHScrollBarMaxPosition(), GdViewer1.GetVScrollBarMaxPosition())
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
if (GdViewer1.HScrollVisible || GdViewer1.VScrollVisible)
    GdViewer1.SetHVScrollBarPosition(GdViewer1.GetHScrollBarMaxPosition(), GdViewer1.GetVScrollBarMaxPosition());
See Also