BoundsSpecified (Enumeración)
Actualización: noviembre 2007
Especifica los límites del control que se utilizarán al definir el tamaño y la posición de un control.
Esta enumeración tiene un atributo FlagsAttribute que permite una combinación bit a bit de los valores de miembro.
Espacio de nombres: System.Windows.FormsEnsamblado: System.Windows.Forms (en System.Windows.Forms.dll)
| Nombre de miembro | Descripción | |
|---|---|---|
|
X | Se define el margen izquierdo del control. |
|
Y | Se define el margen superior del control. |
|
Width | Se define el ancho del control. |
|
Height | Se define el alto del control. |
|
Location | Se definen las coordenadas X y Y del control. |
|
Size | Se definen los valores de las propiedades Width y Height del control. |
|
All | Se definen los valores de las propiedades Location y Size. |
|
None | No se especifican límites. |
Utilice los miembros de esta enumeración al llamar a los métodos SetBoundsCore y SetBoundsde la clase Control.
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).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 Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Contenido de la comunidad
Agregar