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.

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

Fields

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

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