語言

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 整數倍。 若高度為非 的倍 ItemHeight數,則 的 ListBox 高度將以小於高度的最大倍數改變。

通常,對應於指定參數未包含界限的參數會以目前值傳遞。 例如,height屬性的 、 width或 x 屬性yLocation可以參考當前控制項實例。 然而,所有輸入的數值都會被尊重並套用到控制項上。

參數 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) 。

適用於