Costruttore LineShape (ShapeContainer)

Inizializza una nuova istanza di LineShape classe, specificare ShapeContainer dove associati.

Spazio dei nomi:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintassi

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

Parametri

Note

In LineShape non è possibile visualizzare direttamente su un form o un controllo contenitore, deve essere inserito in una classe ShapeContainer oggetto.Dopo avere inizializzato un oggetto LineShape, sarà necessario impostarne Parent proprietà o a un oggetto esistente ShapeContainer o a una nuova istanza di ShapeContainer.

Esempi

Nell'esempio seguente viene inizializzato con ShapeContainer e LineShape, set Parent proprietà di LineShape in ShapeContainere visualizzata una linea in diagonale.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

LineShape Classe

Overload LineShape

Spazio dei nomi Microsoft.VisualBasic.PowerPacks

Altre risorse

Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)

Procedura: disegnare linee con il controllo LineShape (Visual Studio)

Introduzione ai controlli Line e Shape (Visual Studio)