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.

適用於

另請參閱