Compartir a través de


OvalShape (Constructor) (Int32, Int32, Int32, Int32)

Inicializa una nueva instancia de la clase OvalShape, especificando su 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 OvalShape(
    int left,
    int top,
    int width,
    int height
)
public:
OvalShape(
    int left, 
    int top, 
    int width, 
    int height
)
new : 
        left:int * 
        top:int * 
        width:int * 
        height:int -> OvalShape
public function OvalShape(
    left : int, 
    top : int, 
    width : int, 
    height : int
)

Parámetros

  • left
    Tipo: Int32
  • top
    Tipo: Int32
  • width
    Tipo: Int32

    Integer que representa el ancho, en píxeles, del OvalShape.

  • height
    Tipo: Int32

    Integer que representa el alto, en píxeles, del OvalShape.

Comentarios

Un control de OvalShape no se puede mostrar directamente en un formulario o un control contenedor; debe encontrarse en un objeto de ShapeContainer . Después de inicializar OvalShape, tendrá que establecer la propiedad de Parent a ShapeContainer existente o una nueva instancia de ShapeContainer.

Ejemplos

El ejemplo siguiente se crea ShapeContainer y OvalShape, los agrega a un formulario, y muestra un círculo de 100 diámetros de píxeles.

Private Sub DrawCircle2()
    Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
    ' Declare an OvalShape and set the location and size. 
    Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20,
      120, 120)
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me 
    ' Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas
End Sub
private void DrawCircle2()
{
    Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
        new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
    // Declare an OvalShape and set the location and size.
    Microsoft.VisualBasic.PowerPacks.OvalShape oval1 = 
        new Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20, 120, 120);
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas;
}

Seguridad de .NET Framework

Vea también

Referencia

OvalShape Clase

OvalShape (Sobrecarga)

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)