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 屬性為 true ,且 Multiline 屬性為,則控制項會使用屬性來設定界限 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 可以將、或屬性的 XY 屬性 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參數代表應用程式所變更之控制項的元素 BoundsThe specified parameter represents the elements of the controls Bounds changed by your application. 例如,如果您變更控制項的 Size ,則 specified 參數值為的 SizeBoundsSpecifiedFor example, if you change the Size of the control, the specified parameter value is the Size value of BoundsSpecified. 但是,如果為了 Size 回應所設定的屬性而調整 Dock ,則 specified 參數值為的 NoneBoundsSpecifiedHowever, 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.

適用於