.NET Framework Class Library
ScrollableControlScrollToControl Method

Calculates the scroll offset to the specified child control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
Syntax
Protected Overridable Function ScrollToControl ( _
	activeControl As [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_0_0_0%] _
) As [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_0_0_1%]
protected virtual [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_1_0_0%] ScrollToControl(
	[%$TOPIC/x9zh64bd_en-us_VS_110_1_0_1_0_1%] activeControl
)
protected:
virtual [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_2_0_0%] ScrollToControl(
	[%$TOPIC/x9zh64bd_en-us_VS_110_1_0_2_0_1%]^ activeControl
)
abstract ScrollToControl : 
        activeControl:[%$TOPIC/x9zh64bd_en-us_VS_110_1_0_3_0_0%] -> [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_3_0_1%]  
override ScrollToControl : 
        activeControl:[%$TOPIC/x9zh64bd_en-us_VS_110_1_0_3_0_2%] -> [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_3_0_3%]
protected function ScrollToControl(
	activeControl : [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_4_0_0%]
) : [%$TOPIC/x9zh64bd_en-us_VS_110_1_0_4_0_1%]

Parameters

activeControl
Type: System.Windows.FormsControl

The child control to scroll into view.

Return Value

Type: System.DrawingPoint
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.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1