共用方式為


LineShape 建構函式 (Int32, Int32, Int32, Int32)

初始化的新執行個體LineShape類別,指定線條座標。

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

語法

'宣告
Public Sub New ( _
    x1 As Integer, _
    y1 As Integer, _
    x2 As Integer, _
    y2 As Integer _
)
public LineShape(
    int x1,
    int y1,
    int x2,
    int y2
)
public:
LineShape(
    int x1, 
    int y1, 
    int x2, 
    int y2
)
new : 
        x1:int * 
        y1:int * 
        x2:int * 
        y2:int -> LineShape
public function LineShape(
    x1 : int, 
    y1 : int, 
    x2 : int, 
    y2 : int
)

參數

  • x1
    類型:Int32

    線條起點的 X (水平) 座標。

  • y1
    類型:Int32

    線條起點的 Y (垂直) 座標。

  • x2
    類型:Int32

    線條終點的 X (水平) 座標。

  • y2
    類型:Int32

    線條終點的 Y (垂直) 座標。

備註

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(0,
    0, 1000, 1000)
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me 
' Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas
Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
    new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
Microsoft.VisualBasic.PowerPacks.LineShape line1 = 
    new Microsoft.VisualBasic.PowerPacks.LineShape(0, 0, 1000, 1000);
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the LineShape.
line1.Parent = canvas;

.NET Framework 安全性

請參閱

參考

LineShape 類別

LineShape 多載

Microsoft.VisualBasic.PowerPacks 命名空間

ShapeContainer

Shape

其他資源

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

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

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