SimpleShape.ClientRectangle (Propiedad)
Obtiene el rectángulo que representa el área de cliente de la forma.
Espacio de nombres: Microsoft.VisualBasic.PowerPacks
Ensamblado: Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxis
'Declaración
<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 with get
function get ClientRectangle () : Rectangle
Valor de propiedad
Tipo: Rectangle
Rectangle en píxeles, respecto del control primario, que representa el tamaño y la ubicación de la forma.
Comentarios
Puede llamar a la SetBounds método para cambiar la ClientRectangle propiedad en una sola operación.
Dado que SimpleShape no tiene ningún área no cliente, la Bounds y ClientRectangle propiedades son las mismas.
Ejemplos
En el ejemplo siguiente se muestra cómo utilizar el DrawToBitmap método y ClientRectangle propiedad para dibujar un OvalShape en la parte superior de un PictureBox control.
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;
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Vea también
Referencia
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)