LineShape-Konstruktor (ShapeContainer)

Initialisiert eine neue Instanz der LineShape-Klasse und gibt ShapeContainer an, in dem das Objekt übergeordnet ist.

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

Syntax

'Declaration
Public Sub New ( _
    parent As ShapeContainer _
)
public LineShape(
    ShapeContainer parent
)
public:
LineShape(
    ShapeContainer^ parent
)
new : 
        parent:ShapeContainer -> LineShape
public function LineShape(
    parent : ShapeContainer
)

Parameter

Hinweise

LineShape kann nicht direkt auf einem Formular oder einem Containersteuerelement angezeigt werden. Es muss sich auf einem ShapeContainer-Objekt gehostet werden.Nachdem Sie LineShapeinitialisieren, müssen Sie deren Parent-Eigenschaft entweder auf vorhandenen ShapeContainer oder einer neuen Instanz von ShapeContainerfestlegen.

Beispiele

Im folgenden Beispiel wird ShapeContainer und LineShape, legt die Parent-Eigenschaft LineShape zu ShapeContainerfest und zeigt eine diagonale Linie an.

Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
Dim line1 As New Microsoft.VisualBasic.PowerPacks.LineShape
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas
' Set the starting and ending coordinates for the line.
line1.StartPoint = New System.Drawing.Point(0, 0)
line1.EndPoint = New System.Drawing.Point(1000, 1000)
Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
    new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
Microsoft.VisualBasic.PowerPacks.LineShape line1 = 
    new Microsoft.VisualBasic.PowerPacks.LineShape();
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas;
// Set the starting and ending coordinates for the line.
line1.StartPoint = new System.Drawing.Point(0, 0);
line1.EndPoint = new System.Drawing.Point(1000, 1000);

.NET Framework-Sicherheit

Siehe auch

Referenz

LineShape Klasse

LineShape-Überladung

Microsoft.VisualBasic.PowerPacks-Namespace

Weitere Ressourcen

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

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

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