共用方式為


LineShape 建構函式

初始化 LineShape 類別的新執行個體。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public Sub New
public LineShape()
public:
LineShape()
new : unit -> LineShape
public function LineShape()

備註

ALineShape無法直接在表單或容器的控制項,顯示控制項它必須裝載於ShapeContainer物件。 您初始化之後LineShape,您就必須設定其Parent屬性到現有ShapeContainer或的新執行個體ShapeContainer

範例

下列範例會初始化ShapeContainerLineShape,設定Parent屬性LineShapeShapeContainer,並顯示對角線。

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

.NET Framework 安全性

請參閱

參考

LineShape 類別

LineShape 多載

Microsoft.VisualBasic.PowerPacks 命名空間

ShapeContainer

Shape

其他資源

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

Line 和 Shape 控制項簡介 (Visual Studio)