BoundsSpecified 列挙型

定義

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

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

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

フィールド

All 15

Location プロパティと Size プロパティの両方の値が定義されるように指定します。

Height 8

コントロールの高さが定義されるように指定します。

Location 3

コントロールの X 座標と Y 座標が両方とも定義されるように指定します。

None 0

範囲は指定されていません。

Size 12

コントロールの Width プロパティと Height プロパティの両方の値が定義されるように指定します。

Width 4

コントロールの幅が定義されるように指定します。

X 1

コントロールの左端が定義されるように指定します。

Y 2

コントロールの上端が定義されるように指定します。

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

注釈

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

適用対象

こちらもご覧ください