Compartir a través de


LineShape (Clase)

Actualización: noviembre 2007

Representa un control mostrado como líneas horizontales, verticales o diagonales.

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

Sintaxis

<ToolboxBitmapAttribute(GetType(LineShape), "Microsoft.VisualBasic.PowerPacks.LineShape.bmp")> _
Public Class LineShape _
    Inherits Shape

Dim instance As LineShape
[ToolboxBitmapAttribute(typeof(LineShape), "Microsoft.VisualBasic.PowerPacks.LineShape.bmp")]
public class LineShape : Shape
[ToolboxBitmapAttribute(typeof(LineShape), L"Microsoft.VisualBasic.PowerPacks.LineShape.bmp")]
public ref class LineShape : public Shape
public class LineShape extends Shape

Comentarios

El control LineShape le permite dibujar líneas en un formulario o contenedor en tiempo de diseño o en tiempo de ejecución.

Cuando se agrega un control de línea o forma a un formulario o contenedor, se crea un objeto ShapeContainer invisible. ShapeContainer actúa como una superficie de dibujo para las formas dentro de cada control contenedor; cada ShapeContainer tiene un ShapeCollection correspondiente que le permite recorrer en iteración los controles de líneas y formas.

Al crear un control LineShape en tiempo de ejecución, debe crear también ShapeContainer y establecer la propiedad Parent de LineShape en ShapeContainer.

Ejemplos

En el siguiente ejemplo se crean un ShapeContainer y un LineShape, se agregan a un formulario y se muestra una línea vertical de la parte superior a la parte inferior del formulario.

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(Me.Width / 2, 0)
line1.EndPoint = New System.Drawing.Point(Me.Width / 2, Me.Height)
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(this.Width / 2, 0);
line1.EndPoint = new System.Drawing.Point(this.Width / 2, this.Height);

Jerarquía de herencia

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.VisualBasic.PowerPacks.Shape
        Microsoft.VisualBasic.PowerPacks.LineShape

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Vea también

Referencia

LineShape (Miembros)

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

ShapeContainer

Shape

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)