Aracılığıyla paylaş


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

Name Değer Description
None 0

Denetim yerleşik değil.

Top 1

Denetimin üst kenarı, denetim içeren denetiminin en üstüne yerleştirilmiştir.

Bottom 2

Denetimin alt kenarı, denetim içeren öğesinin altına yerleştirilmiştir.

Left 3

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

Right 4

Denetimin sağ kenarı, denetim içeren denetiminin sağ kenarı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.

Örnekler

Aşağıdaki örnek, bir GroupBox oluşturur ve bazı ortak özelliklerini 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 boşaltılmış olarak konumlandırılır. Bir kenarda birden fazla denetim varsa, denetimler z düzenine göre yan yana görünür; z düzeninde 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ı, denetimin ilgili kenarlarının boyutuna göre yeniden boyutlandırılır. Dolgu seçiliyse, denetimin dört kenarı da, denetimi içeren kenarlarla eşleşecek şekilde yeniden boyutlandırılır.

Şunlara uygulanır

Ayrıca bkz.