BoundsSpecified Enumerazione

Definizione

Specifica i limiti del controllo da utilizzare quando si definiscono le dimensioni e la posizione di un controllo.

Questa enumerazione supporta una combinazione bit per bit dei rispettivi valori dei membri.

public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified = 
Public Enum BoundsSpecified
Ereditarietà
BoundsSpecified
Attributi

Campi

Nome Valore Descrizione
None 0

Non vengono specificati limiti.

X 1

Specifica che il bordo sinistro del controllo è definito.

Y 2

Specifica che il bordo superiore del controllo è definito.

Location 3

Specifica che sono definite sia le X coordinate che Y le coordinate del controllo.

Width 4

Specifica che la larghezza del controllo è definita.

Height 8

Specifica che l'altezza del controllo è definita.

Size 12

Specifica che sono definiti sia i valori delle WidthHeight proprietà che i valori della proprietà del controllo.

All 15

Specifica che sono definiti i valori delle Location proprietà e Size .

Esempio

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

Commenti

Utilizzare i membri di questa enumerazione quando si chiamano i SetBoundsCore metodi e SetBounds della Control classe .

Si applica a

Vedi anche