IScrollProvider.SetScrollPercent Method (Double, Double)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sets the horizontal and vertical scroll position as a percentage of the total content area within the control.

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

void SetScrollPercent(
	double horizontalPercent,
	double verticalPercent
)

Parameters

horizontalPercent
Type: System.Double

The horizontal position as a percentage of the content area's total range. NoScroll should be passed in if the control cannot be scrolled in this direction.

verticalPercent
Type: System.Double

The vertical position as a percentage of the content area's total range. NoScroll should be passed in if the control cannot be scrolled in this direction.

Exception Condition
ArgumentException

A value that cannot be converted to a double is passed in.

ArgumentOutOfRangeException

A value greater than 100 or less than 0 is passed in (except -1, which is equivalent to NoScroll). The HorizontalScrollPercent and VerticalScrollPercent values are normalized to either 100 percent or 0 percent.

InvalidOperationException

An attempt is made to scroll in an unsupported direction.

This method is only useful when the content area of the control is larger than the visible region.

Passing in the value NoScroll indicates that there is no scrolling in the specified direction.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: