Propriedade SimpleShape.Size

Obtém ou define a altura e largura da forma.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxe

<BrowsableAttribute(True)> _
Public Property Size As Size

Dim instance As SimpleShape
Dim value As Size

value = instance.Size

instance.Size = value
[BrowsableAttribute(true)]
public Size Size { get; set; }
[BrowsableAttribute(true)]
public:
property Size Size {
    Size get ();
    void set (Size value);
}
public function get Size () : Size
public function set Size (value : Size)

Valor de propriedade

Tipo: System.Drawing.Size
The Size que representa a altura e largura da forma em pixels.

Comentários

The Width e Height propriedades representam a largura e altura da forma. Você pode usar o Size propriedade para obter o dimensionar da forma para tarefas sistema autônomo desenho em que a superfície da forma.

Porque SimpleShape não tem nenhuma área que não é destinada aos clientes, o ClientSize e Size propriedades são os mesmos.

Exemplos

O exemplo a seguir demonstra como usar o Size propriedade para redimensionar um OvalShape controle. Este exemplo requer que você tenha um OvalShape controle chamado OvalShape1 em um formulário.

PrivateSub OvalShape1_Click(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) Handles OvalShape1.Click
    ' Declare a Size 20 pixels wider and taller than the current Size.Dim sz AsNew System.Drawing.Size(OvalShape1.Width + 20, _
      OvalShape1.Height + 20)
    ' Change the Size.
    OvalShape1.Size = sz
EndSub
privatevoid 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;
}

Permissões

Consulte também

Referência

SimpleShape Classe

Membros SimpleShape

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

Introdução à linha e controles de forma (Visual Studio)

Como: Desenhar linhas com o Controlarar de LineShape (Visual Studio)

Como: Desenhar formas com a OvalShape e controles de RectangleShape (Visual Studio)