LineShape (Constructor) (ShapeContainer)
Inicializa una nueva instancia de la clase LineShape, especificando el ShapeContainer donde se relacionará con un elemento primario.
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
parent
Tipo: Microsoft.VisualBasic.PowerPacks.ShapeContainerShapeContainer donde la forma se relacionará.
Comentarios
Un LineShape no se puede mostrar directamente en un formulario o control contenedor; deben estar hospedado en un ShapeContainer objeto. Después de inicializar un LineShape, tendrá que establecer su Parent propiedad a una existente ShapeContainer o a una nueva instancia de ShapeContainer.
Ejemplos
En el ejemplo siguiente se inicializa un ShapeContainer y un LineShape, establece la Parent propiedad de la LineShape a la ShapeContainery 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
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Vea también
Referencia
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)