Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

BoundsSpecified Enumeration

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.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
[FlagsAttribute]
public enum BoundsSpecified
Member nameDescription
Supported by the .NET Compact FrameworkXThe left edge of the control is defined.
Supported by the .NET Compact FrameworkYThe top edge of the control is defined.
Supported by the .NET Compact FrameworkWidthThe width of the control is defined.
Supported by the .NET Compact FrameworkHeightThe height of the control is defined.
Supported by the .NET Compact FrameworkLocationBoth X and Y coordinates of the control are defined.
Supported by the .NET Compact FrameworkSizeBoth Width and Height property values of the control are defined.
Supported by the .NET Compact FrameworkAllBoth Location and Size property values are defined.
Supported by the .NET Compact FrameworkNoneNo bounds are specified.

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

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.