ScrollableControl.ScrollToControl(Control) Method

Definition

Calculates the scroll offset to the specified child control.

protected virtual System.Drawing.Point ScrollToControl (System.Windows.Forms.Control activeControl);

Parameters

activeControl
Control

The child control to scroll into view.

Returns

The upper-left hand Point of the display area relative to the client area required to scroll the control into view.

Remarks

The ScrollControlIntoView method uses the ScrollToControl method to calculate how far it must scroll to display the specified control. The AutoScrollOffset property of the child control is used to adjust the scrolled position.

ScrollToControl does not cause scrolling; the SetDisplayRectLocation method is typically used to subsequently scroll to the calculated position.

Applies to

제품 버전
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also