ScrollableControl.ScrollToControl(Control) 方法

定义

计算到指定子控件的滚动偏移量。Calculates the scroll offset to the specified child control.

protected:
 virtual System::Drawing::Point ScrollToControl(System::Windows::Forms::Control ^ activeControl);
protected virtual System.Drawing.Point ScrollToControl (System.Windows.Forms.Control activeControl);
abstract member ScrollToControl : System.Windows.Forms.Control -> System.Drawing.Point
override this.ScrollToControl : System.Windows.Forms.Control -> System.Drawing.Point
Protected Overridable Function ScrollToControl (activeControl As Control) As Point

参数

activeControl
Control

要滚动到视图中的子控件。The child control to scroll into view.

返回

显示区域的左上 Point(相对于将控件滚动到视图所需的工作区)。The upper-left hand Point of the display area relative to the client area required to scroll the control into view.

注解

ScrollControlIntoView 方法ScrollToControl使用方法来计算在显示指定控件时,它必须滚动多远。The ScrollControlIntoView method uses the ScrollToControl method to calculate how far it must scroll to display the specified control. AutoScrollOffset控件的属性用于调整滚动位置。The AutoScrollOffset property of the child control is used to adjust the scrolled position.

ScrollToControl不会导致滚动;SetDisplayRectLocation方法通常用于滚动到计算的位置。ScrollToControl does not cause scrolling; the SetDisplayRectLocation method is typically used to subsequently scroll to the calculated position.

适用于

另请参阅