SimpleShape.Top 属性

获取或设置距离,以像素为单位),则形状的上边缘与其容器的工作区左边缘之间。

命名空间:  Microsoft.VisualBasic.PowerPacks
程序集:  Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

语法

声明
<BrowsableAttribute(False)> _
Public Property Top As Integer
[BrowsableAttribute(false)]
public int Top { get; set; }
[BrowsableAttribute(false)]
public:
property int Top {
    int get ();
    void set (int value);
}
[<BrowsableAttribute(false)>]
member Top : int with get, set
function get Top () : int
function set Top (value : int)

属性值

类型:System.Int32
表示距离,以像素为单位,在控件上边缘与其容器的工作区之间上边缘的 Int32

备注

Top 属性值具有形状的 Location 属性值的 y 参数等效。

所做的更改。 Height 和 Top 属性值导致形状的 Bottom 属性值更改。

可以使用 Location 属性更改 Left 和 Top 属性更改单个语句的形状的位置。

示例

下面的示例演示如何使用 Left 和 Top 属性更改形状的位置。 此示例要求您具有名为在窗体的 RectangleShape1 的一个 RectangleShape 控件。

Private Sub RectangleShape1_Click_1() Handles RectangleShape1.Click
    ' Set the left edge.
    RectangleShape1.Left = 10
    ' Set the top edge.
    RectangleShape1.Top = 10
End Sub
private void rectangleShape1_Click_1(System.Object sender, System.EventArgs e)
{
    // Set the left edge.
    rectangleShape1.Left = 10;
    // Set the top edge.
    rectangleShape1.Top = 10;
}

.NET Framework 安全性

请参见

参考

SimpleShape 类

Microsoft.VisualBasic.PowerPacks 命名空间

其他资源

Line 和 Shape 控件简介 (Visual Studio)

如何:使用 LineShape 控件绘制直线 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控件绘制形状 (Visual Studio)