通过


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可以使用对控件的当前实例的引用传入属性或xy属性Locationwidth 但是,将遵循传入的所有值并将其应用于控件。

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) 方法添加大小限制。

适用于