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

定義

設定 ListBox 控制項的指定繫結。

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 屬性值。

y
Int32

控制項的新 Top 屬性值。

width
Int32

控制項的新 Width 屬性值。

height
Int32

控制項的新 Height 屬性值。

specified
BoundsSpecified

BoundsSpecified 值的位元組合。

備註

控制項的高度 ListBox 會隨著 屬性的 ItemHeight 倍數而增加和減少。 如果 height 是不是 倍數的數位 ItemHeight ,則 的高度 ListBox 將會變更為小於高度的最大倍數。

一般而言,對應至指定參數中未包含之界限的參數會以其目前的值傳入。 例如, heightwidth 屬性的 Locationx y 屬性可以使用控制項目前實例的參考傳入。 不過,所有傳入的值都會接受並套用至 控制項。

參數 specified 代表應用程式所變更之控制項 Bounds 的專案。 例如,如果您變更 Size 控制項的 ,則 specified 參數值為 Size 。 不過,如果 Size 已調整 以回應 Dock 所設定的屬性, specified 則參數值為 None

給繼承者的注意事項

SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 衍生類別中覆寫時,請務必呼叫基類的 SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 方法來強制控制項的界限變更。 衍生類別可以將大小限制新增至 SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 方法。

適用於