Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Inicializa una nueva instancia de la clase de RectangleShape , especificando la ubicación y tamaño.
Espacio de nombres: Microsoft.VisualBasic.PowerPacks
Ensamblado: Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxis
'Declaración
Public Sub New ( _
left As Integer, _
top As Integer, _
width As Integer, _
height As Integer _
)
public RectangleShape(
int left,
int top,
int width,
int height
)
public:
RectangleShape(
int left,
int top,
int width,
int height
)
new :
left:int *
top:int *
width:int *
height:int -> RectangleShape
public function RectangleShape(
left : int,
top : int,
width : int,
height : int
)
Parámetros
- left
Tipo: System.Int32
- top
Tipo: System.Int32
- width
Tipo: System.Int32
Integer que representa el ancho (en píxeles) de RectangleShape.
- height
Tipo: System.Int32
Integer que representa el alto (en píxeles) de RectangleShape.
Comentarios
Un control de RectangleShape no se puede mostrar directamente en un formulario o un control contenedor; debe encontrarse en un objeto de ShapeContainer .Después de inicializar RectangleShape, tendrá que establecer la propiedad de Parent a ShapeContainer existente o una nueva instancia de ShapeContainer.
Ejemplos
El ejemplo siguiente se crea ShapeContainer y RectangleShape, los agrega a un formulario, y muestra un píxel 90 por el cuadrado de 90 píxeles.
Private Sub DrawSquare()
Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
' Declare a RectangleShape and set the location and size.
Dim rect1 As New Microsoft.VisualBasic.PowerPacks.
RectangleShape(15, 15, 105, 105)
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' Set the ShapeContainer as the parent of the RectangleShape.
rect1.Parent = canvas
End Sub
private void DrawSquare()
{
Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas =
new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
// Declare a RectangleShape and set the location and size.
Microsoft.VisualBasic.PowerPacks.RectangleShape rect1 =
new Microsoft.VisualBasic.PowerPacks.RectangleShape(15, 15, 105, 105);
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the RectangleShape.
rect1.Parent = canvas;
}
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)