IVsTextView.GetScrollInfo Method

Returns the core text editor's scroll bar settings for the specified scroll bar.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int GetScrollInfo(
	int iBar,
	out int piMinUnit,
	out int piMaxUnit,
	out int piVisibleUnits,
	out int piFirstVisibleUnit


Type: System.Int32

[in] Specifies a horizontal or vertical scroll bar. Values may be either SB_HORZ or SB_VERT. For more information, see GetScrollInfo in the Platform SDK.

Type: System.Int32

[out] Minimum scroll bar unit.

Type: System.Int32

[out] Maximum scroll bar unit.

Type: System.Int32

[out] Additional number of visible units in the scroll bar.

Type: System.Int32

[out] First visible unit in the scroll bar.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From textmgr.idl:

HRESULT IVsTextView::GetScrollInfo(
   [in] long iBar,
   [out] long *piMinUnit,
   [out] long *piMaxUnit,
   [out] long *piVisibleUnits,
   [out] long *piFirstVisibleUnit

The piFirstVisibleUnit and piVisibleUnits parameters define the visible range in the view. For example, if lines 10 through 25 were visible in the view, then piFirstVisibleUnit would have a value of 10 and piVisibleUnits would have a value of 15.


Scroll bar information is not guaranteed to directly match line information. The values returned are based on the core text editor settings.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft