BoundsSpecified 列挙型

定義

コントロールのサイズと位置を定義するときに使用するコントロールの境界を指定します。

この列挙体は、メンバー値のビットごとの組み合わせをサポートしています。

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified = 
Public Enum BoundsSpecified
継承
BoundsSpecified
属性

フィールド

名前 説明
None 0

境界は指定されません。

X 1

コントロールの左端を定義することを指定します。

Y 2

コントロールの上端を定義することを指定します。

Location 3

コントロールの X 座標と Y 座標の両方を定義することを指定します。

Width 4

コントロールの幅を定義することを指定します。

Height 8

コントロールの高さを定義することを指定します。

Size 12

コントロールの WidthHeight の両方のプロパティ値を定義することを指定します。

All 15

LocationSizeの両方のプロパティ値を定義することを指定します。

private:
   void MyForm_Layout( Object^ /*sender*/, System::Windows::Forms::LayoutEventArgs^ /*e*/ )
   {
      // Center the Form on the user's screen everytime it requires a Layout.
      this->SetBounds( (Screen::GetBounds( this ).Width / 2) - (this->Width / 2), (Screen::GetBounds( this ).Height / 2) - (this->Height / 2), this->Width, this->Height, BoundsSpecified::Location );
   }
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
   // Center the Form on the user's screen everytime it requires a Layout.
   this.SetBounds((Screen.GetBounds(this).Width/2) - (this.Width/2),
       (Screen.GetBounds(this).Height/2) - (this.Height/2),
       this.Width, this.Height, BoundsSpecified.Location);	
}

Private Sub MyForm_Layout(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout

    ' Center the Form on the user's screen everytime it requires a Layout.
    Me.SetBounds((System.Windows.Forms.Screen.GetBounds(Me).Width / 2) - (Me.Width / 2), _
        (System.Windows.Forms.Screen.GetBounds(Me).Height / 2) - (Me.Height / 2), _
        Me.Width, Me.Height, System.Windows.Forms.BoundsSpecified.Location)
End Sub

注釈

この列挙体のメンバーは、Control クラスのSetBoundsCoreメソッドとSetBounds メソッドを呼び出すときに使用します。

適用対象

こちらもご覧ください