Control.ScaleControl(SizeF, BoundsSpecified) 方法

定义

缩放控件的位置、大小、空白和边距。Scales a control's location, size, padding and margin.

protected:
 virtual void ScaleControl(System::Drawing::SizeF factor, System::Windows::Forms::BoundsSpecified specified);
protected virtual void ScaleControl (System.Drawing.SizeF factor, System.Windows.Forms.BoundsSpecified specified);
abstract member ScaleControl : System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> unit
override this.ScaleControl : System.Drawing.SizeF * System.Windows.Forms.BoundsSpecified -> unit
Protected Overridable Sub ScaleControl (factor As SizeF, specified As BoundsSpecified)

参数

factor
SizeF

控件高度和宽度的缩放因子。The factor by which the height and width of the control will be scaled.

specified
BoundsSpecified

一个 BoundsSpecified 值,指定在定义控件的大小和位置时要使用的控件边界。A BoundsSpecified value that specifies the bounds of the control to use when defining its size and position.

示例

BoundsSpecified

Scale

GetScaledBounds

SetBoundsCore

注解

如果控件为顶级控件,则不会缩放控件的位置。If the control is top level, this will not scale the control's location. 这不会缩放子级或自动调整大小的控件的大小。This does not scale children or the size of automatically sized controls. 您可以通过更改 specified 参数的值,忽略任何方向的缩放。You can omit scaling in any direction by changing the value of the specified parameter.

适用于