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

顯示區域的左上 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.

適用於

另請參閱