Example





In This Topic
GdPicture14 Namespace / GdViewer Class / GetHScrollBarMaxPosition Method

GetHScrollBarMaxPosition Method (GdViewer)

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 GetHScrollBarMaxPosition() As Integer
public int GetHScrollBarMaxPosition()
public function GetHScrollBarMaxPosition(): Integer; 
public function GetHScrollBarMaxPosition() : int;
public: int GetHScrollBarMaxPosition(); 
public:
int GetHScrollBarMaxPosition(); 

Return Value

A maximum coordinate on the horizontal axis accessible for the horizontal scrollbar, in pixels.
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.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