ListBox.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置控件的 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)
参数
- specified
- BoundsSpecified
值的按位组合 BoundsSpecified 。
注解
控件的高度 ListBox 增加和减少属性的 ItemHeight 倍数。 如果高度不是倍 ItemHeight数,则 ListBox 高度将因小于高度的最大倍数而改变。
通常,与指定参数中不包含的边界对应的参数会随其当前值一起传入。 例如,height可以使用对控件的当前实例的引用传入属性或xy属性Location。 width 但是,将遵循传入的所有值并将其应用于控件。
该 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) 方法添加大小限制。