Compartir a través de


SimpleShape.Size (Propiedad)

Obtiene o establece el alto y el ancho de la forma.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
<BrowsableAttribute(True)> _
Public Property Size As Size
[BrowsableAttribute(true)]
public Size Size { get; set; }
[BrowsableAttribute(true)]
public:
property Size Size {
    Size get ();
    void set (Size value);
}
[<BrowsableAttribute(true)>]
member Size : Size with get, set
function get Size () : Size 
function set Size (value : Size)

Valor de propiedad

Tipo: Size
Size que representa el ancho y el alto de la forma, en píxeles.

Comentarios

El Width y Height propiedades representan el ancho y alto de la forma. Puede utilizar el Size propiedad para obtener el tamaño de la forma de realizar tareas como dibujar en la superficie de la forma.

Dado que SimpleShape no tiene ningún área no cliente, la ClientSize y Size propiedades son las mismas.

Ejemplos

En el ejemplo siguiente se muestra cómo utilizar el Size propiedad para cambiar el tamaño de una OvalShape control. Este ejemplo requiere que haya un OvalShape control denominado OvalShape1 en un formulario.

Private Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Declare a Size 20 pixels wider and taller than the current Size. 
    Dim sz As New System.Drawing.Size(OvalShape1.Width + 20, 
      OvalShape1.Height + 20)
    ' Change the Size.
    OvalShape1.Size = sz
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Declare a Size 20 pixels wider and taller than the current Size.
    System.Drawing.Size sz = new System.Drawing.Size(ovalShape1.Width + 20, 
        ovalShape1.Height + 20);
    // Change the Size.
    ovalShape1.Size = sz;
}

Seguridad de .NET Framework

Vea también

Referencia

SimpleShape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Introducción a los controles de líneas y formas (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)