Share via


Splitter.MinExtra Özellik

Tanım

Bölücü denetimi ile kapsayıcının karşı tarafının kenarı (veya bu tarafa yerleştirilmiş en yakın denetim) arasında kalması gereken en düşük uzaklığı alır veya ayarlar. MinExtra içindeki benzer özelliklerle SplitContainer değiştirilmiştir ve yalnızca önceki sürümlerle uyumluluk için sağlanır.

public:
 property int MinExtra { int get(); void set(int value); };
public int MinExtra { get; set; }
member this.MinExtra : int with get, set
Public Property MinExtra As Integer

Özellik Değeri

Denetim ile kapsayıcının karşı tarafının Splitter kenarı (veya bu tarafa yerleştirilmiş en yakın denetim) arasındaki piksel cinsinden minimum uzaklık. Varsayılan değer 25’tir.

Örnekler

Aşağıdaki kod örneği, Windows Gezgini'ne benzer bir Splitter pencere oluşturmak için ve ListView denetimleriyle TreeView birlikte bir denetim kullanır. ve ListView denetimlerini TreeView tanımlamak için düğümler ve öğeler her iki denetime de eklenir. Örnek, veya denetiminin MinExtraSplitter çok küçük veya ListView çok büyük boyutlandırılmasını önlemek TreeView için ve MinSize özelliklerini kullanır. Bu örnekte oluşturulan yöntemin içinde Form tanımlanması ve yönteminin oluşturucusundan Formçağrılmış olması gerekir.

private:
   void CreateMySplitControls()
   {
      // Create TreeView, ListView, and Splitter controls.
      TreeView^ treeView1 = gcnew TreeView;
      ListView^ listView1 = gcnew ListView;
      Splitter^ splitter1 = gcnew Splitter;

      // Set the TreeView control to dock to the left side of the form.
      treeView1->Dock = DockStyle::Left;

      // Set the Splitter to dock to the left side of the TreeView control.
      splitter1->Dock = DockStyle::Left;

      // Set the minimum size the ListView control can be sized to.
      splitter1->MinExtra = 100;

      // Set the minimum size the TreeView control can be sized to.
      splitter1->MinSize = 75;

      // Set the ListView control to fill the remaining space on the form.
      listView1->Dock = DockStyle::Fill;

      // Add a TreeView and a ListView item to identify the controls on the form.
      treeView1->Nodes->Add( "TreeView Node" );
      listView1->Items->Add( "ListView Item" );

      // Add the controls in reverse order to the form to ensure proper location.
      array<Control^>^temp0 = {listView1,splitter1,treeView1};
      this->Controls->AddRange( temp0 );
   }
private void CreateMySplitControls()
{
    // Create TreeView, ListView, and Splitter controls.
    TreeView treeView1 = new TreeView();
    ListView listView1 = new ListView();
    Splitter splitter1 = new Splitter();

    // Set the TreeView control to dock to the left side of the form.
    treeView1.Dock = DockStyle.Left;
    // Set the Splitter to dock to the left side of the TreeView control.
    splitter1.Dock = DockStyle.Left;
    // Set the minimum size the ListView control can be sized to.
    splitter1.MinExtra = 100;
    // Set the minimum size the TreeView control can be sized to.
    splitter1.MinSize = 75;
    // Set the ListView control to fill the remaining space on the form.
    listView1.Dock = DockStyle.Fill;
    // Add a TreeView and a ListView item to identify the controls on the form.
    treeView1.Nodes.Add("TreeView Node");
    listView1.Items.Add("ListView Item");

    // Add the controls in reverse order to the form to ensure proper location.
    this.Controls.AddRange(new Control[]{listView1, splitter1, treeView1});
}
Private Sub CreateMySplitControls()
   ' Create TreeView, ListView, and Splitter controls.
   Dim treeView1 As New TreeView()
   Dim listView1 As New ListView()
   Dim splitter1 As New Splitter()
   
   ' Set the TreeView control to dock to the left side of the form.
   treeView1.Dock = DockStyle.Left
   ' Set the Splitter to dock to the left side of the TreeView control.
   splitter1.Dock = DockStyle.Left
   ' Set the minimum size the ListView control can be sized to.
      splitter1.MinExtra = 100
   ' Set the minimum size the TreeView control can be sized to.
      splitter1.MinSize = 75
   ' Set the ListView control to fill the remaining space on the form.
      listView1.Dock = DockStyle.Fill

      ' Add a TreeView and a ListView item to identify the controls on the form.
      treeView1.Nodes.Add("TreeView Node")
      listView1.Items.Add("ListView Item")
   
   ' Add the controls in reverse order to the form to ensure proper location.
   Me.Controls.AddRange(New Control() {listView1, splitter1, treeView1})
End Sub

Açıklamalar

Yatay Splitter denetim (kapsayıcının üstüne veya altına yerleştirilmiş bir Splitter denetim) için, çıkarılmış denetimler için ayrılmış kapsayıcı alanının en düşük yüksekliği, denetimin Splitter yüksekliğinin bu değerden çıkarılmasıdır. Dikey Splitter denetim için (kapsayıcının Splitter soluna veya sağındaki bir denetim) çıkarılmış denetimler için ayrılmış kapsayıcı alanının en küçük genişliği, denetimin genişliğinin Splitter bu değerden çıkarılmasıdır. Kullanıcı, ayırıcıyı bu özellik tarafından belirtilen sınırı aşarak taşıyamaz.

Not

MinExtra Özellik negatif bir değere ayarlanırsa, özellik değeri 0 olarak sıfırlanır.

Şunlara uygulanır

Ayrıca bkz.