# RectangleRectangleRectangleRectangle Class

## Definición

Dibuja un rectángulo.Draws a rectangle.

public ref class Rectangle sealed : System::Windows::Shapes::Shape
public sealed class Rectangle : System.Windows.Shapes.Shape
type Rectangle = class
inherit Shape
Public NotInheritable Class Rectangle
Inherits Shape
Herencia

## Ejemplos

El ejemplo siguiente muestra cómo crear un Rectangle y establezca sus propiedades mediante el uso de código.The following example shows how to create a Rectangle element and set its properties by using code.

myRect = gcnew Rectangle();
myRect->Stroke = Brushes::Black;
myRect->Fill = Brushes::SkyBlue;
myRect->HorizontalAlignment = HorizontalAlignment::Left;
myRect->VerticalAlignment = VerticalAlignment::Center;
myRect->Height = 50;
myRect->Width = 50;

myRect = new System.Windows.Shapes.Rectangle();
myRect.Stroke = System.Windows.Media.Brushes.Black;
myRect.Fill = System.Windows.Media.Brushes.SkyBlue;
myRect.HorizontalAlignment = HorizontalAlignment.Left;
myRect.VerticalAlignment = VerticalAlignment.Center;
myRect.Height = 50;
myRect.Width = 50;

Dim myRect As New Rectangle()
myRect.Stroke = Brushes.Black
myRect.Stroke = Brushes.Black
myRect.Fill = Brushes.SkyBlue
myRect.HorizontalAlignment = HorizontalAlignment.Left
myRect.VerticalAlignment = VerticalAlignment.Center
myRect.Height = 50
myRect.Width = 50

## Constructores

 Rectangle() Rectangle() Rectangle() Rectangle() Inicializa una nueva instancia de la clase Rectangle.Initializes a new instance of the Rectangle class.