Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified) 方法

定義

擷取縮放控制項的範圍。Retrieves the bounds within which the control is scaled.

protected:
 virtual System::Drawing::Rectangle GetScaledBounds(System::Drawing::Rectangle bounds, System::Drawing::SizeF factor, System::Windows::Forms::BoundsSpecified specified);
protected virtual System.Drawing.Rectangle GetScaledBounds (System.Drawing.Rectangle bounds, System.Drawing.SizeF factor, System.Windows.Forms.BoundsSpecified specified);
abstract member GetScaledBounds : System.Drawing.Rectangle * System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> System.Drawing.Rectangle
override this.GetScaledBounds : System.Drawing.Rectangle * System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> System.Drawing.Rectangle
Protected Overridable Function GetScaledBounds (bounds As Rectangle, factor As SizeF, specified As BoundsSpecified) As Rectangle

參數

bounds
Rectangle

Rectangle,指定要為其擷取顯示範圍的區域。A Rectangle that specifies the area for which to retrieve the display bounds.

factor
SizeF

控制項範圍的高度和寬度。The height and width of the control's bounds.

specified
BoundsSpecified

其中一個 BoundsSpecified 值,指定在定義控制項的大小和位置時所用的控制項範圍。One of the values of BoundsSpecified that specifies the bounds of the control to use when defining its size and position.

傳回

Rectangle,表示縮放控制項的範圍。A Rectangle representing the bounds within which the control is scaled.

備註

這是由 ScaleControl 所呼叫的 helper 方法,用來抓取調整控制項的範圍。This is a helper method that is called by ScaleControl to retrieve the bounds within which the control is scaled. 您可以覆寫這個方法,以重複使用 ScaleControl 調整邏輯,但您必須提供自己的界限。You can override this method to reuse the ScaleControl scaling logic, but you must supply your own bounds. 預設的實值會傳回縮放界限,將 specified 界限、控制項是否為最上層、控制項是否為固定寬度或自動大小,以及控制項可能擁有的任何裝飾。The default implementation returns scaled bounds that take into account the specified bounds, whether the control is top level, whether the control is fixed width or auto size, and any adornments the control might have.

適用於

另請參閱