BoundsSpecified Wyliczenie

Definicja

Określa granice kontrolki do użycia podczas definiowania rozmiaru i położenia kontrolki.

To wyliczenie obsługuje bitową kombinację jego wartości składowych.

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified = 
Public Enum BoundsSpecified
Dziedziczenie
BoundsSpecified
Atrybuty

Pola

All 15

Określa, że zarówno wartości właściwości, jak Location i Size są zdefiniowane.

Height 8

Określa, że wysokość kontrolki jest zdefiniowana.

Location 3

Określa, że X zarówno współrzędne i Y kontrolki są zdefiniowane.

None 0

Nie określono żadnych granic.

Size 12

Określa, że zarówno Width wartości właściwości, jak i Height kontrolki są zdefiniowane.

Width 4

Określa, że szerokość kontrolki jest zdefiniowana.

X 1

Określa, że lewa krawędź kontrolki jest zdefiniowana.

Y 2

Określa, że górna krawędź kontrolki jest zdefiniowana.

Przykłady

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

Uwagi

Użyj składowych tego wyliczenia podczas wywoływania SetBoundsCore metod Control i SetBounds klasy .

Dotyczy

Zobacz też