Edit

Share via


BoundsSpecified Enum

Definition

Specifies the bounds of the control to use when defining a control's size and position.

This enumeration supports a bitwise combination of its member values.

C#
[System.Flags]
public enum BoundsSpecified
Inheritance
BoundsSpecified
Attributes

Fields

Name Value Description
None 0

No bounds are specified.

X 1

Specifies that the left edge of the control is defined.

Y 2

Specifies that the top edge of the control is defined.

Location 3

Specifies that both the X and Y coordinates of the control are defined.

Width 4

Specifies that the width of the control is defined.

Height 8

Specifies that the height of the control is defined.

Size 12

Specifies that both the Width and Height property values of the control are defined.

All 15

Specifies that both the Location and Size property values are defined.

Examples

C#
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
   // Center the Form on the user's screen everytime it requires a Layout.
   this.SetBounds((Screen.GetBounds(this).Width/2) - (this.Width/2),
       (Screen.GetBounds(this).Height/2) - (this.Height/2),
       this.Width, this.Height, BoundsSpecified.Location);	
}

Remarks

Use the members of this enumeration when calling the SetBoundsCore and SetBounds methods of the Control class.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also