Freigeben über


OvalShape-Konstruktor

Initialisiert eine neue Instanz der OvalShape-Klasse.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
Public Sub New
public OvalShape()
public:
OvalShape()
new : unit -> OvalShape
public function OvalShape()

Hinweise

Ein OvalShape-Steuerelement kann nicht direkt auf ein Formular oder ein Containersteuerelement angezeigt werden; muss in einem ShapeContainer-Objekt enthalten sind. Nachdem Sie OvalShape initialisieren, müssen Sie seine Parent-Eigenschaft entweder auf ein vorhandenes ShapeContainer oder auf eine neue Instanz von ShapeContainer festlegen.

Beispiele

Im folgenden Beispiel wird ShapeContainer und OvalShape, wird ihnen ein Formular hinzu und zeigt einen Kreissegment.

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;
}

.NET Framework-Sicherheit

Siehe auch

Referenz

OvalShape Klasse

OvalShape-Überladung

Microsoft.VisualBasic.PowerPacks-Namespace

Weitere Ressourcen

Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Formen mit dem OvalShape-Steuerelement und dem RectangleShape-Steuerelement (Visual Studio)