Export (0) Print
Expand All

ListBox.SetBoundsCore Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Sets the specified bounds of the ListBox control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected override void SetBoundsCore(
	int x,
	int y,
	int width,
	int height,
	BoundsSpecified specified
)

Parameters

x
Type: System.Int32

The new Left property value of the control.

y
Type: System.Int32

The new Top property value of the control.

width
Type: System.Int32

The new Width property value of the control.

height
Type: System.Int32

The new Height property value of the control.

specified
Type: System.Windows.Forms.BoundsSpecified

A bitwise combination of the BoundsSpecified values.

The height of the ListBox control increases and decreases by a multiple of the ItemHeight property. If height is a number that is not a multiple of ItemHeight, the height of the ListBox will change by the largest multiple that is less than height.

Typically, the parameters that correspond to the bounds not included in the specified parameter are passed in with their current values. 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.

The specified parameter represents the elements of the controls Bounds changed by your application. For example, if you change the Size of the control, the specified parameter value is Size. However, if the Size is adjusted in response to the Dock property being set, the specified parameter value is None.

Notes to Inheritors

When overriding SetBoundsCore in a derived class, be sure to call the base class's SetBoundsCore method to force the bounds of the control to change. Derived classes can add size restrictions to the SetBoundsCore method.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft