LineShape (Constructor) (ShapeContainer)

Inicializa una nueva instancia de la clase de LineShape , especificando ShapeContainer donde relacionada con.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

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

Parámetros

Comentarios

LineShape no se puede mostrar directamente en un formulario o un control contenedor; debe hospedarse en un objeto de ShapeContainer .Después de inicializar LineShape, tendrá que establecer la propiedad de Parent a ShapeContainer existente o una nueva instancia de ShapeContainer.

Ejemplos

El ejemplo siguiente inicializa ShapeContainer y LineShape, establezca la propiedad de Parent de LineShape a ShapeContainer, y muestra una línea diagonal.

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

Seguridad de .NET Framework

Vea también

Referencia

LineShape Clase

LineShape (Sobrecarga)

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Introducción a los controles de líneas y formas (Visual Studio)