OvalShape 构造函数 (Int32, Int32, Int32, Int32)
初始化 OvalShape 类的新实例,指定其位置和大小。
命名空间: Microsoft.VisualBasic.PowerPacks
程序集: Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
语法
声明
Public Sub New ( _
left As Integer, _
top As Integer, _
width As Integer, _
height As Integer _
)
public OvalShape(
int left,
int top,
int width,
int height
)
public:
OvalShape(
int left,
int top,
int width,
int height
)
new :
left:int *
top:int *
width:int *
height:int -> OvalShape
public function OvalShape(
left : int,
top : int,
width : int,
height : int
)
参数
- left
类型:System.Int32
- top
类型:System.Int32
- width
类型:System.Int32
表示宽度 (以像素为单位) 的 OvalShape的 Integer 。
- height
类型:System.Int32
表示高度 (以像素为单位) OvalShape的 Integer 。
备注
OvalShape 控件直接在窗体或容器控件无法显示;必须在 ShapeContainer 对象包含它。 在初始化 OvalShape后,必须将其 Parent 属性设置为现有 ShapeContainer 或到 ShapeContainer的新实例。
示例
下面的示例创建 ShapeContainer 和 OvalShape,将其添加到窗体中,并显示一个 100 像素直径圆形。
Private Sub DrawCircle2()
Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
' Declare an OvalShape and set the location and size.
Dim oval1 As New Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20,
120, 120)
' Set the form as the parent of the ShapeContainer.
canvas.Parent = Me
' Set the ShapeContainer as the parent of the OvalShape.
oval1.Parent = canvas
End Sub
private void DrawCircle2()
{
Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas =
new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
// Declare an OvalShape and set the location and size.
Microsoft.VisualBasic.PowerPacks.OvalShape oval1 =
new Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20, 120, 120);
// Set the form as the parent of the ShapeContainer.
canvas.Parent = this;
// Set the ShapeContainer as the parent of the OvalShape.
oval1.Parent = canvas;
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.VisualBasic.PowerPacks 命名空间
其他资源
Line 和 Shape 控件简介 (Visual Studio)