次の方法で共有


SimpleShape.SetBounds メソッド

形状の範囲を指定した位置とサイズに設定します。

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

構文

'宣言
Public Sub SetBounds ( _
    left As Integer, _
    top As Integer, _
    width As Integer, _
    height As Integer _
)
public void SetBounds(
    int left,
    int top,
    int width,
    int height
)
public:
void SetBounds(
    int left, 
    int top, 
    int width, 
    int height
)
member SetBounds : 
        left:int * 
        top:int * 
        width:int * 
        height:int -> unit
public function SetBounds(
    left : int, 
    top : int, 
    width : int, 
    height : int
)

パラメーター

  • left
    型 : Int32
  • top
    型 : Int32
  • width
    型 : Int32

    図形の新しい幅プロパティの値。

  • height
    型 : Int32

    図形の新しい値の高さプロパティ。

解説

使用することができます、SetBounds図形のサイズと 1 つのステートメント内の場所を変更するメソッド。

次の例を使用する方法を示しています。、SetBounds図形の位置とサイズを変更するメソッド。 具体的には、図形は、フォームの左上隅に移動でありが四角形に変更します。 この例では、 RectangleShape RectangleShape1 という名前のフォームにコントロールです。

Private Sub RectangleShape1_Click() Handles RectangleShape1.Click
    ' Change the Bounds property.
    RectangleShape1.SetBounds(0, 0, 100, 100)
End Sub
private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
    // Change the Bounds property.
    rectangleShape1.SetBounds(0, 0, 100, 100);
}

.NET Framework セキュリティ

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

参照

関連項目

SimpleShape クラス

Microsoft.VisualBasic.PowerPacks 名前空間

その他の技術情報

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

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

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

and RectangleShape Controls