BoundsSpecified BoundsSpecified BoundsSpecified BoundsSpecified Enum

Definition

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

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
type BoundsSpecified = 
Public Enum BoundsSpecified
Inheritance
BoundsSpecifiedBoundsSpecifiedBoundsSpecifiedBoundsSpecified
Attributes

Fields

All All All All 15

Both Location and Size property values are defined.

Height Height Height Height 8

The height of the control is defined.

Location Location Location Location 3

Both X and Y coordinates of the control are defined.

None None None None 0

No bounds are specified.

Size Size Size Size 12

Both Width and Height property values of the control are defined.

Width Width Width Width 4

The width of the control is defined.

X X X X 1

The left edge of the control is defined.

Y Y Y Y 2

The top edge of the control is defined.

Examples

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 );
   }
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);	
}

Private Sub MyForm_Layout(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout

    ' Center the Form on the user's screen everytime it requires a Layout.
    Me.SetBounds((System.Windows.Forms.Screen.GetBounds(Me).Width / 2) - (Me.Width / 2), _
        (System.Windows.Forms.Screen.GetBounds(Me).Height / 2) - (Me.Height / 2), _
        Me.Width, Me.Height, System.Windows.Forms.BoundsSpecified.Location)
End Sub

Remarks

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

Applies to

See also