Compartir a través de


OvalShape (Clase)

Actualización: noviembre 2007

Representa un control mostrado en forma de círculo u óvalo.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

<ToolboxBitmapAttribute(GetType(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")> _
Public Class OvalShape _
    Inherits SimpleShape

Dim instance As OvalShape
[ToolboxBitmapAttribute(typeof(OvalShape), "Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")]
public class OvalShape : SimpleShape
[ToolboxBitmapAttribute(typeof(OvalShape), L"Microsoft.VisualBasic.PowerPacks.OvalShape.bmp")]
public ref class OvalShape : public SimpleShape
public class OvalShape extends SimpleShape

Comentarios

El control OvalShape le permite dibujar círculos y óvalos en un formulario o contenedor en tiempo de diseño o en tiempo de ejecución.

Cuando se agrega un control de línea o forma a un formulario o contenedor, se crea un objeto ShapeContainer invisible. ShapeContainer actúa como una superficie de dibujo para las formas dentro de cada control contenedor. Cada ShapeContainer tiene un ShapeCollection correspondiente que le permite recorrer en iteración los controles de líneas y formas contenidos en ShapeContainer.

Al crear un control OvalShape en tiempo de ejecución, debe crear también ShapeContainer y establecer la propiedad Parent de OvalShape en ShapeContainer.

Ejemplos

En el siguiente ejemplo se crean un ShapeContainer y un OvalShape, se agregan a un formulario y se muestra un círculo.

Private Sub DrawCircle()
    Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
    Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me
    ' Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas
    ' Set the location and size of the circle.
    oval1.Left = 10
    oval1.Top = 10
    oval1.Width = 100
    oval1.Height = 100
End Sub
private void DrawCircle1()
{
    Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
        new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
    Microsoft.VisualBasic.PowerPacks.OvalShape oval1 = 
        new Microsoft.VisualBasic.PowerPacks.OvalShape();
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    oval1.Parent = canvas;
    // Set the location and size of the circle.
    oval1.Left = 10;
    oval1.Top = 10;
    oval1.Width = 100;
    oval1.Height = 100;
}

Jerarquía de herencia

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.VisualBasic.PowerPacks.Shape
        Microsoft.VisualBasic.PowerPacks.SimpleShape
          Microsoft.VisualBasic.PowerPacks.OvalShape

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Vea también

Referencia

OvalShape (Miembros)

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)