DockStyle Sabit listesi

Tanım

Denetimin yerleştirildiği konumu ve şekli belirtir.

public enum class DockStyle
public enum DockStyle
type DockStyle = 
Public Enum DockStyle
Devralma
DockStyle

Alanlar

Bottom 2

Denetimin alt kenarı, denetimi içeren denetiminin altına yerleştirilmiştir.

Fill 5

Denetimin tüm kenarları, denetimi içeren tüm kenarlarına sabitlenir ve uygun şekilde boyutlandırılır.

Left 3

Denetimin sol kenarı, denetimi içeren denetiminin sol kenarına yerleştirilmiştir.

None 0

Denetim yerleşik değil.

Right 4

Denetimin sağ kenarı, denetim içeren denetiminin sağ kenarına yerleştirilmiştir.

Top 1

Denetimin üst kenarı, denetimin üst kısmına yerleştirilmiştir.

Örnekler

Aşağıdaki örnek, bir GroupBox oluşturur ve ortak özelliklerinden bazılarını ayarlar. Örnek, grup kutusu içinde bir TextBox oluşturur ve ayarlar Location . Ardından, grup kutusunun özelliğini ayarlar Text ve grup kutusunu formun en üstüne sabitler. Son olarak, özelliğini falseolarak ayarlayarak Enabled grup kutusunu devre dışı bırakır ve bu da grup kutusunun içindeki tüm denetimlerin devre dışı bırakılmasına neden olur.

   // Add a GroupBox to a form and set some of its common properties.
private:
   void AddMyGroupBox()
   {
      // Create a GroupBox and add a TextBox to it.
      GroupBox^ groupBox1 = gcnew GroupBox;
      TextBox^ textBox1 = gcnew TextBox;
      textBox1->Location = Point(15,15);
      groupBox1->Controls->Add( textBox1 );

      // Set the Text and Dock properties of the GroupBox.
      groupBox1->Text = "MyGroupBox";
      groupBox1->Dock = DockStyle::Top;

      // Disable the GroupBox (which disables all its child controls)
      groupBox1->Enabled = false;

      // Add the Groupbox to the form.
      this->Controls->Add( groupBox1 );
   }
// Add a GroupBox to a form and set some of its common properties.
private void AddMyGroupBox()
{
   // Create a GroupBox and add a TextBox to it.
   GroupBox groupBox1 = new GroupBox();
   TextBox textBox1 = new TextBox();
   textBox1.Location = new Point(15, 15);
   groupBox1.Controls.Add(textBox1);

   // Set the Text and Dock properties of the GroupBox.
   groupBox1.Text = "MyGroupBox";
   groupBox1.Dock = DockStyle.Top;

   // Disable the GroupBox (which disables all its child controls)
   groupBox1.Enabled = false;

   // Add the Groupbox to the form.
   this.Controls.Add(groupBox1);
}
' Add a GroupBox to a form and set some of its common properties.
Private Sub AddMyGroupBox()
   ' Create a GroupBox and add a TextBox to it.
   Dim groupBox1 As New GroupBox()
   Dim textBox1 As New TextBox()
   textBox1.Location = New Point(15, 15)
   groupBox1.Controls.Add(textBox1)
   
   ' Set the Text and Dock properties of the GroupBox.
   groupBox1.Text = "MyGroupBox"
   groupBox1.Dock = DockStyle.Top
   
   ' Disable the GroupBox (which disables all its child controls)
   groupBox1.Enabled = False
   
   ' Add the Groupbox to the form.
   Me.Controls.Add(groupBox1)
End Sub

Açıklamalar

Bir denetim kapsayıcısının bir kenarına yerleştirildiğinde, kapsayıcı yeniden boyutlandırıldığında her zaman bu kenar üzerinde temizlenmiş olarak konumlandırılır. Bir kenara birden fazla denetim yerleştirilmişse, denetimler z düzenine göre yan yana görünür; z sırası daha yüksek denetimler kapsayıcının kenarından daha uzakta konumlandırılır.

Sol, Sağ, Üst veya Alt seçiliyse, denetimin belirtilen ve karşıt kenarları, ilgili denetimin kenarlarının boyutuna göre yeniden boyutlandırılır. Dolgu seçiliyse, denetimin dört kenarı da içeren denetimin kenarlarıyla eşleşecek şekilde yeniden boyutlandırılır.

Şunlara uygulanır

Ayrıca bkz.