BoundsSpecified Enumeration
.NET Framework 2.0
Specifies the bounds of the control to use when defining a control's size and position.
Assembly: System.Windows.Forms (in system.windows.forms.dll)
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.Windows.FormsAssembly: System.Windows.Forms (in system.windows.forms.dll)
| Member name | Description | |
|---|---|---|
![]() | All | Both Location and Size property values are defined. |
![]() | Height | The height of the control is defined. |
![]() | Location | Both X and Y coordinates of the control are defined. |
![]() | None | No bounds are specified. |
![]() | Size | Both Width and Height property values of the control are defined. |
![]() | Width | The width of the control is defined. |
![]() | X | The left edge of the control is defined. |
![]() | Y | The top edge of the control is defined. |
Use the members of this enumeration when calling the SetBoundsCore and SetBounds methods of the Control class.
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
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).get_Width()
/ 2 - this.get_Width() / 2, Screen.GetBounds(this).get_Height()
/ 2 - this.get_Height() / 2, this.get_Width(), this.get_Height(),
BoundsSpecified.Location);
} //MyForm_Layout
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show:
