次の方法で共有


LineShape.EndPoint プロパティ

取得または設定によって描画される線の終了座標、LineShapeコントロールです。

名前空間:  Microsoft.VisualBasic.PowerPacks
アセンブリ:  Microsoft.VisualBasic.PowerPacks.Vs (Microsoft.VisualBasic.PowerPacks.Vs.dll 内)

構文

'宣言
<BrowsableAttribute(False)> _
Public Property EndPoint As Point
[BrowsableAttribute(false)]
public Point EndPoint { get; set; }
[BrowsableAttribute(false)]
public:
property Point EndPoint {
    Point get ();
    void set (Point value);
}
[<BrowsableAttribute(false)>]
member EndPoint : Point with get, set
function get EndPoint () : Point 
function set EndPoint (value : Point)

プロパティ値

型 : Point
APointを行の終了の座標を表す構造体です。

解説

コンテナーを基準にして、座標、LineShape制御し、は、ピクセル単位で表されます。

設定して、終了の座標を変更することもできる、X2Y2プロパティです。

次の例のスイッチ、LineShapeを斜めの方向にし、垂直方向に水平方向からを使用して、StartPoint軸として。

Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
Dim line1 As New Microsoft.VisualBasic.PowerPacks.LineShape(10, 10, 200, 10)
Private Sub Form1_Load() Handles MyBase.Load
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me 
    ' Set the ShapeContainer as the parent of the LineShape.
    line1.Parent = canvas
End Sub 
Private Sub Form1_Click() Handles Me.Click
    ChangeOrientation()
End Sub 
Private Sub ChangeOrientation()
    Static direction As String = "horizontal" 
    If direction = "horizontal" Then 
        ' Change the orientation to diagonal.
        line1.EndPoint = New System.Drawing.Point(200, 200)
        direction = "diagonal" 
    ElseIf direction = "diagonal" Then 
        ' Change the orientation to vertical.
        line1.EndPoint = New System.Drawing.Point(line1.X1, 200)
        direction = "vertical" 
    Else 
        ' Change the orientation to horizontal.
        line1.EndPoint = New System.Drawing.Point(200, line1.Y1)
        direction = "horizontal" 
    End If 
End Sub
        Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas = 
            new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
        Microsoft.VisualBasic.PowerPacks.LineShape line1 = 
            new Microsoft.VisualBasic.PowerPacks.LineShape(10, 10, 200, 10);
        string direction;
        private void Form1_Load(System.Object sender, System.EventArgs e)
        {
            // Set the form as the parent of the ShapeContainer.
            canvas.Parent = this;
            // Set the ShapeContainer as the parent of the LineShape.
            line1.Parent = canvas;
            direction = "horizontal";
        }
        private void Form1_Click(object sender, System.EventArgs e)
        {
            ChangeOrientation();
        }

        private void ChangeOrientation()
        {

            if (direction == "horizontal")
            // Change the orientation to diagonal.
            {
                line1.EndPoint = new System.Drawing.Point(200, 200);
                direction = "diagonal";
            }
            else if (direction == "diagonal")
            {
                line1.EndPoint = new System.Drawing.Point(line1.X1, 200);
                direction = "vertical";
            }
            else
            {
                // Change the orientation to horizontal.
                line1.EndPoint = new System.Drawing.Point(200, line1.Y1);
                direction = "horizontal";
            }
        }

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

LineShape クラス

Microsoft.VisualBasic.PowerPacks 名前空間

ShapeContainer

Shape

その他の技術情報

方法 : OvalShape コントロールおよび RectangleShape コントロールを使用して図形を描画する (Visual Studio)

方法 : LineShape コントロールを使用して線を描画する (Visual Studio)

ライン コントロールとシェイプ コントロールの概要 (Visual Studio)