System.Windows.Forms.ScrollableControl.ScrollToControl Method

Calculates the scroll offset to the specified child control.

Syntax

protected virtual System.Drawing.Point ScrollToControl (Control activeControl)

Parameters

activeControl
The child control to scroll into view.

Returns

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

Remarks

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

ScrollableControl.ScrollToControl(Control) does not cause scrolling; the ScrollableControl.SetDisplayRectLocation(int, int) method is typically used to subsequently scroll to the calculated position.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0