Propriedade SimpleShape.ClientRectangle

Obtém o retângulo que representa a área de cliente da forma.

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

Sintaxe

'Declaração
<BrowsableAttribute(False)> _
Public ReadOnly Property ClientRectangle As Rectangle
[BrowsableAttribute(false)]
public Rectangle ClientRectangle { get; }
[BrowsableAttribute(false)]
public:
property Rectangle ClientRectangle {
    Rectangle get ();
}
[<BrowsableAttribute(false)>]
member ClientRectangle : Rectangle
function get ClientRectangle () : Rectangle

Valor de propriedade

Tipo: System.Drawing.Rectangle
A Rectangle em pixels, em relação ao controle pai, que representa o tamanho e o local da forma.

Comentários

Você pode chamar o SetBounds método para alterar o ClientRectangle propriedade em uma única operação.

Porque SimpleShape não tem nenhuma área não-cliente, o Bounds e ClientRectangle propriedades são iguais.

Exemplos

O exemplo a seguir demonstra como usar o DrawToBitmap método e a ClientRectangle propriedade para desenhar um OvalShape na parte superior de um PictureBox controle.

Private Sub Form1_Load() Handles MyBase.Load
    Dim pic As New System.Drawing.Bitmap(Me.PictureBox1.Image, 
      PictureBox1.Width, PictureBox1.Height)
    Dim rect As New System.Drawing.Rectangle
    ' Assign the client rectangle.
    rect = OvalShape1.ClientRectangle
    ' Draw the oval on the bitmap.
    OvalShape1.DrawToBitmap(pic, rect)
    PictureBox2.Image = pic
End Sub
private void form1_Load(System.Object sender, System.EventArgs e)
{
    System.Drawing.Bitmap pic = new System.Drawing.Bitmap(this.pictureBox1.Image, 
        pictureBox1.Width, pictureBox1.Height);
    System.Drawing.Rectangle rect = new System.Drawing.Rectangle();
    // Assign the client rectangle.
    rect = ovalShape1.ClientRectangle;
    // Draw the oval on the bitmap.
    ovalShape1.DrawToBitmap(pic, rect);
    pictureBox2.Image = pic;
}

Segurança do .NET Framework

Consulte também

Referência

SimpleShape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

Como: desenhar linhas com o controle de LineShape (Visual Studio)

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