TextBoxBase.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 方法

定义

设置 TextBoxBase 控件的指定边界。Sets the specified bounds of the TextBoxBase control.

protected:
 override void SetBoundsCore(int x, int y, int width, int height, System::Windows::Forms::BoundsSpecified specified);
protected override void SetBoundsCore (int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified);
override this.SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -> unit
Protected Overrides Sub SetBoundsCore (x As Integer, y As Integer, width As Integer, height As Integer, specified As BoundsSpecified)

参数

x
Int32

控件的新 Left 属性值。The new Left property value of the control.

y
Int32

控件的新 Top 属性值。The new Top property value of the control.

width
Int32

控件的新 Width 属性值。The new Width property value of the control.

height
Int32

未使用。Not used.

specified
BoundsSpecified

BoundsSpecified 值的按位组合。A bitwise combination of the BoundsSpecified values.

注解

TextBoxBase PreferredHeight 如果 AutoSize 属性为 trueMultiline 属性为,则控件使用属性来设置边界 falseThe TextBoxBase control uses the PreferredHeight property to set the bounds if the AutoSize property is true and the Multiline property is false.

通常,与参数中未包含的界限相对应的参数 specified 将与当前值一起传入。Typically, the parameters that correspond to the bounds not included in the specified parameter are passed in with their current values. 例如, Height Width 可以将属性的、或 X 属性 Y Location 与控件的当前实例的引用一起传入。For example, the Height, Width, or the X or Y properties of the Location property can be passed in with a reference to the current instance of the control. 但是,传入的所有值都将生效并应用于控件。However all values passed in are honored and applied to the control.

specified参数表示 Bounds 由您的应用程序更改的控件的元素。The specified parameter represents the elements of the controls Bounds changed by your application. 例如,如果更改 Size 控件的,则 specified 参数值为 Size 的值 BoundsSpecifiedFor example, if you change the Size of the control, the specified parameter value is the Size value of BoundsSpecified. 但是,如果 Size 在响应所设置的属性时调整 Dock ,则 specified 参数值为 None 的值 BoundsSpecifiedHowever, if the Size is adjusted in response to the Dock property being set, the specified parameter value is the None value of BoundsSpecified.

继承者说明

SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 在派生类中重写时,请确保调用基类的 SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 方法来强制更改控件边界。When overriding SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) in a derived class, be sure to call the base class's SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) method to force the bounds of the control to change. 派生类可以向方法添加大小限制 SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)Derived classes can add size restrictions to the SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) method.

适用于