Partilhar via


Propriedade SimpleShape.ClientSize

Obtém ou define a altura e largura da área do cliente da forma.

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

Sintaxe

'Declaração
<BrowsableAttribute(False)> _
Public Property ClientSize As Size
[BrowsableAttribute(false)]
public Size ClientSize { get; set; }
[BrowsableAttribute(false)]
public:
property Size ClientSize {
    Size get ();
    void set (Size value);
}
[<BrowsableAttribute(false)>]
member ClientSize : Size with get, set
function get ClientSize () : Size 
function set ClientSize (value : Size)

Valor de propriedade

Tipo: Size
Um Size que representa as dimensões da área cliente da forma.

Comentários

O Width e Height propriedades representam a largura e altura da área do cliente da forma. Você pode usar o ClientSize propriedade para obter o tamanho da área do cliente da forma para tarefas como desenhar na superfície da forma.

Como SimpleShape não tem nenhuma área não cliente, o ClientSize e Size propriedades são as mesmas.

Exemplos

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

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 ClientSize.
    OvalShape1.ClientSize = 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 ClientSize.
    ovalShape1.ClientSize = sz;
}

Segurança do .NET Framework

Consulte também

Referência

SimpleShape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

Como desenhar linhas com o controle LineShape (Visual Studio)

Como desenhar formas com os controles OvalShape e RectangleShape (Visual Studio)