Rediger

Del via


IScrollProvider.SetScrollPercent(Double, Double) Method

Definition

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

public:
 void SetScrollPercent(double horizontalPercent, double verticalPercent);
public void SetScrollPercent (double horizontalPercent, double verticalPercent);
abstract member SetScrollPercent : double * double -> unit
Public Sub SetScrollPercent (horizontalPercent As Double, verticalPercent As Double)

Parameters

horizontalPercent
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
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.

Exceptions

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

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.

An attempt is made to scroll in an unsupported direction.

Remarks

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.

Applies to

See also