Este tema aún no ha recibido ninguna valoración - Valorar este tema

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.Forms
Ensamblado:  System.Windows.Forms (en System.Windows.Forms.dll)
[FlagsAttribute]
public enum BoundsSpecified
/** @attribute FlagsAttribute */
public enum BoundsSpecified
public enum BoundsSpecified
Nombre de miembro Descripción
cdck12k0.CFW(es-es,VS.90).gif X Se define el margen izquierdo del control.
cdck12k0.CFW(es-es,VS.90).gif Y Se define el margen superior del control.
cdck12k0.CFW(es-es,VS.90).gif Width Se define el ancho del control.
cdck12k0.CFW(es-es,VS.90).gif Height Se define el alto del control.
cdck12k0.CFW(es-es,VS.90).gif Location Se definen las coordenadas X y Y del control.
cdck12k0.CFW(es-es,VS.90).gif Size Se definen los valores de las propiedades Width y Height del control.
cdck12k0.CFW(es-es,VS.90).gif All Se definen los valores de las propiedades Location y Size.
cdck12k0.CFW(es-es,VS.90).gif 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.

.NET Framework

Compatible con: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Compatible con: 3.5, 2.0
¿Le ha resultado útil?
(Caracteres restantes: 1500)
Contenido de la comunidad Agregar