Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
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
- parent
Tipo: Microsoft.VisualBasic.PowerPacks.ShapeContainer
ShapeContainer donde la forma relacionada con
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
- 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)