BoundsSpecified Enum

Definisi

Menentukan batas kontrol yang akan digunakan saat menentukan ukuran dan posisi kontrol.

Enumerasi ini mendukung kombinasi bitwise dari nilai yang termasuk di dalamnya.

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified = 
Public Enum BoundsSpecified
Warisan
BoundsSpecified
Atribut

Bidang

Nama Nilai Deskripsi
None 0

Tidak ada batasan yang ditentukan.

X 1

Menentukan bahwa tepi kiri kontrol ditentukan.

Y 2

Menentukan bahwa tepi atas kontrol ditentukan.

Location 3

Menentukan bahwa koordinat X kontrol dan Y ditentukan.

Width 4

Menentukan bahwa lebar kontrol ditentukan.

Height 8

Menentukan bahwa tinggi kontrol ditentukan.

Size 12

Menentukan bahwa Width nilai properti dan Height kontrol ditentukan.

All 15

Menentukan bahwa nilai Location properti dan Size ditentukan.

Contoh

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

Keterangan

Gunakan anggota enumerasi ini saat memanggil SetBoundsCore metode SetBounds dan Control kelas.

Berlaku untuk

Lihat juga