OvalShape-Konstruktor (Int32, Int32, Int32, Int32)
Initialisiert eine neue Instanz der OvalShape-Klasse, die Position und Größe angibt.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
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
)
Parameter
- left
Typ: Int32
- top
Typ: Int32
width
Typ: Int32Eine Integer, die die Breite (in Pixel) der OvalShape darstellt.
height
Typ: Int32Eine Integer, die die Höhe der OvalShape in Pixel darstellt.
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 Durchmesserkreis mit 100 Pixel an.
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;
}
.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)