Share via


LineShape-Konstruktor (Int32, Int32, Int32, Int32)

Initialisiert eine neue Instanz der LineShape-Klasse und gibt die Koordinaten für die Zeile an.

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

Syntax

'Declaration
Public Sub New ( _
    x1 As Integer, _
    y1 As Integer, _
    x2 As Integer, _
    y2 As Integer _
)
public LineShape(
    int x1,
    int y1,
    int x2,
    int y2
)
public:
LineShape(
    int x1, 
    int y1, 
    int x2, 
    int y2
)
new : 
        x1:int * 
        y1:int * 
        x2:int * 
        y2:int -> LineShape
public function LineShape(
    x1 : int, 
    y1 : int, 
    x2 : int, 
    y2 : int
)

Parameter

  • x1
    Typ: System.Int32
    Die horizontale Koordinate) (x-Koordinate des Anfangspunkts der Linie.
  • y1
    Typ: System.Int32
    Die Koordinate Ys (vertikal) des Anfangspunkts der Linie.
  • x2
    Typ: System.Int32
    Die horizontale Koordinate) (x-Koordinate des Endpunkts der Linie.
  • y2
    Typ: System.Int32
    Die Koordinate Ys (vertikal) des Endpunkts der Linie.

Hinweise

LineShape kann nicht direkt auf einem Formular oder einem Containersteuerelement angezeigt werden. Sie muss 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 mit den angegebenen Koordinaten an.

Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
Dim line1 As New Microsoft.VisualBasic.PowerPacks.LineShape(0,
    0, 1000, 1000)
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas
Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
    new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
Microsoft.VisualBasic.PowerPacks.LineShape line1 = 
    new Microsoft.VisualBasic.PowerPacks.LineShape(0, 0, 1000, 1000);
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas;

.NET Framework-Sicherheit

Siehe auch

Referenz

LineShape Klasse

LineShape-Überladung

Microsoft.VisualBasic.PowerPacks-Namespace

ShapeContainer

Shape

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)