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 を初期化すると、既存の ShapeContainer または ShapeContainer の新しいインスタンスに Parent のプロパティを設定する必要があります。
例
次の例では 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 名前空間
その他の技術情報
ライン コントロールとシェイプ コントロールの概要 (Visual Studio)
方法 : LineShape コントロールを使用して線を描画する (Visual Studio)
方法 : OvalShape コントロールおよび RectangleShape コントロールを使用して図形を描画する (Visual Studio)