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 einem Formular oder einem Containersteuerelement angezeigt werden. Es muss sich in einem ShapeContainer-Objekt enthalten sind.Nachdem Sie OvalShapeinitialisieren, müssen Sie deren Parent-Eigenschaft entweder auf vorhandenen ShapeContainer oder einer neuen Instanz von ShapeContainerfestlegen.
Beispiele
Im folgenden Beispiel wird ShapeContainer und OvalShape, fügt sie einem Formular hinzu und zeigt einen Kreis dargestellt.
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
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.
Siehe auch
Referenz
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)