SplitContainer.Dock Özellik

Tanım

Kapsayıcının kenarlarına hangi SplitContainer kenarlıkların eklendiğini alır veya ayarlar.

public:
 property System::Windows::Forms::DockStyle Dock { System::Windows::Forms::DockStyle get(); void set(System::Windows::Forms::DockStyle value); };
public System.Windows.Forms.DockStyle Dock { get; set; }
member this.Dock : System.Windows.Forms.DockStyle with get, set
Public Property Dock As DockStyle

Özellik Değeri

DockStyle

Değerlerden DockStyle biri. None varsayılan değerdir.

Örnekler

Aşağıdaki kod örneği, özelliği olarak Fillayarlanmış bir dikey bölücü Dock gösterir. Dikey ayırıcının diğer temel özellikleri de gösterilir. Bu örnek, sınıfı için SplitContainer sağlanan daha büyük bir örneğin bir parçasıdır.

// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
splitContainer1->ForeColor = System::Drawing::SystemColors::Control;
splitContainer1->Location = System::Drawing::Point( 0, 0 );
splitContainer1->Name = "splitContainer1";

// You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1->Panel1MinSize = 30;

// You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1->Panel2MinSize = 20;
splitContainer1->Size = System::Drawing::Size( 292, 273 );
splitContainer1->SplitterDistance = 79;

// This splitter moves in 10-pixel increments.
splitContainer1->SplitterIncrement = 10;
splitContainer1->SplitterWidth = 6;

// splitContainer1 is the first control in the tab order.
splitContainer1->TabIndex = 0;
splitContainer1->Text = "splitContainer1";

// When the splitter moves, the cursor changes shape.
splitContainer1->SplitterMoved += gcnew System::Windows::Forms::SplitterEventHandler( this, &Form1::splitContainer1_SplitterMoved );
splitContainer1->SplitterMoving += gcnew System::Windows::Forms::SplitterCancelEventHandler( this, &Form1::splitContainer1_SplitterMoving );

// Add a TreeView control to the left panel.
splitContainer1->Panel1->BackColor = System::Drawing::SystemColors::Control;

// Add a TreeView control to Panel1.
splitContainer1->Panel1->Controls->Add( treeView1 );
splitContainer1->Panel1->Name = "splitterPanel1";

// Controls placed on Panel1 support right-to-left fonts.
splitContainer1->Panel1->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
splitContainer1.ForeColor = System.Drawing.SystemColors.Control;
splitContainer1.Location = new System.Drawing.Point(0, 0);
splitContainer1.Name = "splitContainer1";
// You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1.Panel1MinSize = 30;
// You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1.Panel2MinSize = 20;
splitContainer1.Size = new System.Drawing.Size(292, 273);
splitContainer1.SplitterDistance = 79;
// This splitter moves in 10-pixel increments.
splitContainer1.SplitterIncrement = 10;
splitContainer1.SplitterWidth = 6;
// splitContainer1 is the first control in the tab order.
splitContainer1.TabIndex = 0;
splitContainer1.Text = "splitContainer1";
// When the splitter moves, the cursor changes shape.
splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(splitContainer1_SplitterMoved);
splitContainer1.SplitterMoving += new System.Windows.Forms.SplitterCancelEventHandler(splitContainer1_SplitterMoving);

// Add a TreeView control to the left panel.
splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control;
// Add a TreeView control to Panel1.
splitContainer1.Panel1.Controls.Add(treeView1);
splitContainer1.Panel1.Name = "splitterPanel1";
// Controls placed on Panel1 support right-to-left fonts.
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
' Basic SplitContainer properties.
' This is a vertical splitter that moves in 10-pixel increments.
' This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
splitContainer1.ForeColor = System.Drawing.SystemColors.Control
splitContainer1.Location = New System.Drawing.Point(0, 0)
splitContainer1.Name = "splitContainer1"
' You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1.Panel1MinSize = 30
' You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1.Panel2MinSize = 20
splitContainer1.Size = New System.Drawing.Size(292, 273)
splitContainer1.SplitterDistance = 79
' This splitter moves in 10-pixel increments.
splitContainer1.SplitterIncrement = 10
splitContainer1.SplitterWidth = 6
' splitContainer1 is the first control in the tab order.
splitContainer1.TabIndex = 0
splitContainer1.Text = "splitContainer1"
  
' Add a TreeView control to the left panel.
splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control
' Add a TreeView control to Panel1.
splitContainer1.Panel1.Controls.Add(treeView1)
splitContainer1.Panel1.Name = "splitterPanel1"
' Controls placed on Panel1 support right-to-left fonts.
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes

Açıklamalar

bir'i SplitContainer kapsayıcısının herhangi bir kenarına sabitleyebilir veya kapsayıcının tüm kenarlarına yerleştirerek SplitContainer kapsayıcıyı SplitContainer tamamen doldurabilirsiniz. Örneğin, kapsayıcısının sol kenarına sol kenarını SplitContainer eklemek için bu özelliği DockStyle.Left olarak ayarlayın. Denetimler z sırasına göre sabitlenir.

Not

Z düzeni ekranın derinlik boyutuna karşılık gelir ve x-sırası ve y düzeni sırasıyla yatay ve dikey boyutlara karşılık gelir. Z düzeni, denetimlerin veya pencerelerin ekranda aynı alanla örtüşebileceği veya kapladığı durumlarda, önünde hangi nesnenin görüneceğini tanımlar. Z sırasının en üstündeki denetim veya pencere diğer tüm denetimlerin veya pencerelerin üzerinde görünür ve özelliğinde Controls 0 dizini tarafından başvurulur. Z düzeninin en altındaki denetim veya pencere diğer tüm denetimlerin veya pencerelerin altında görünür ve özelliğindeki Controls dizini (Controls.Count-1) tarafından başvurulur.

Bağlama ve yerleştirme denetimleri hakkında daha fazla bilgi için bkz. Nasıl yapılır: Windows Forms ile Çok Sayfalı Kullanıcı Arabirimi Oluşturma.

Şunlara uygulanır

Ayrıca bkz.