Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / GetHorizontalScrollBarMaxPosition Method

GetHorizontalScrollBarMaxPosition Method

In This Topic
Gets a maximum available position of the horizontal scrollbar, in pixels, related to the document currently displayed in the GdViewer control. That said, it is a maximum coordinate on the horizontal axis, which the horizontal scrollbar can reach on the displayed document according to the current control settings.
Syntax
'Declaration
 
Public Function GetHorizontalScrollBarMaxPosition() As Double
public double GetHorizontalScrollBarMaxPosition()
public function GetHorizontalScrollBarMaxPosition(): Double; 
public function GetHorizontalScrollBarMaxPosition() : double;
public: double GetHorizontalScrollBarMaxPosition(); 
public:
double GetHorizontalScrollBarMaxPosition(); 

Return Value

A maximum coordinate on the horizontal axis accessible for the horizontal scrollbar.
Remarks
You can regularly apply the GetStat method to determine if this method has been successful.
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