ToolBar.ToolBarButtonCollection Sınıf

Tanım

Dikkat

ToolBar is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use ToolStrip instead.

sınıfı tarafından ToolBarButton kullanılmak üzere bir denetim koleksiyonunu ToolBar kapsüller.

public: ref class ToolBar::ToolBarButtonCollection : System::Collections::IList
public class ToolBar.ToolBarButtonCollection : System.Collections.IList
[System.ComponentModel.Browsable(false)]
[System.Obsolete("`ToolBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `ToolStrip` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public class ToolBar.ToolBarButtonCollection : System.Collections.IList
type ToolBar.ToolBarButtonCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("`ToolBar` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `ToolStrip` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")>]
type ToolBar.ToolBarButtonCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ToolBar.ToolBarButtonCollection
Implements IList
Devralma
ToolBar.ToolBarButtonCollection
Öznitelikler
Uygulamalar

Örnekler

Aşağıdaki kod örneği bir ToolBar ve üç ToolBarButton denetim oluşturur ve başlatır. Araç çubuğu düğmeleri araç çubuğuna atanır ve araç çubuğu forma eklenir. Bu kod için önceden oluşturulmuş bir Form kod gerekir.

public:
   void InitializeMyToolBar()
   {
      // Create and initialize the ToolBarButton controls and ToolBar.
      ToolBar^ toolBar1 = gcnew ToolBar;
      ToolBarButton^ toolBarButton1 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton2 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton3 = gcnew ToolBarButton;
      
      // Set the Text properties of the ToolBarButton controls.
      toolBarButton1->Text = "Open";
      toolBarButton2->Text = "Save";
      toolBarButton3->Text = "Print";
      
      // Add the ToolBarButton controls to the ToolBar.
      toolBar1->Buttons->Add( toolBarButton1 );
      toolBar1->Buttons->Add( toolBarButton2 );
      toolBar1->Buttons->Add( toolBarButton3 );
      
      // Add the ToolBar to the Form.
      Controls->Add( toolBar1 );
   }
public void InitializeMyToolBar()
 {
    // Create and initialize the ToolBarButton controls and ToolBar.
    ToolBar toolBar1 = new ToolBar();
    ToolBarButton toolBarButton1 = new ToolBarButton();
    ToolBarButton toolBarButton2 = new ToolBarButton();
    ToolBarButton toolBarButton3 = new ToolBarButton();
 
    // Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open";
    toolBarButton2.Text = "Save";
    toolBarButton3.Text = "Print";
 
    // Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1);
    toolBar1.Buttons.Add(toolBarButton2);
    toolBar1.Buttons.Add(toolBarButton3);
 
    // Add the ToolBar to the Form.
    Controls.Add(toolBar1);
 }
Public Sub InitializeMyToolBar()
    ' Create and initialize the ToolBarButton controls and ToolBar.
    Dim toolBar1 As New ToolBar()
    Dim toolBarButton1 As New ToolBarButton()
    Dim toolBarButton2 As New ToolBarButton()
    Dim toolBarButton3 As New ToolBarButton()
    
    ' Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open"
    toolBarButton2.Text = "Save"
    toolBarButton3.Text = "Print"
    
    ' Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1)
    toolBar1.Buttons.Add(toolBarButton2)
    toolBar1.Buttons.Add(toolBarButton3)
    
    ' Add the ToolBar to the Form.
    Controls.Add(toolBar1)
End Sub

Açıklamalar

, ToolBar.ToolBarButtonCollection sınıfı tarafından araç çubuğuna ToolBar atanan tüm ToolBarButton denetimleri tutmak için kullanılan sıfır tabanlı dizinli bir koleksiyondur. Add Tek tek düğmeleri eklemek için yöntemini ve Remove bunları silmek için yöntemini kullanın. Koleksiyondaki Clear tüm düğmeleri kaldırmak için yöntemini çağırın.

Oluşturucular

Name Description
ToolBar.ToolBarButtonCollection(ToolBar)
Geçersiz.

Sınıfının yeni bir örneğini ToolBar.ToolBarButtonCollection başlatır ve belirtilen araç çubuğuna atar.

Özellikler

Name Description
Count
Geçersiz.

Araç çubuğu düğme koleksiyonundaki düğme sayısını alır.

IsReadOnly
Geçersiz.

Koleksiyonun salt okunur olup olmadığını belirten bir değer alır.

Item[Int32]
Geçersiz.

Araç çubuğu düğmesi koleksiyonunda belirtilen dizinlenmiş konumdaki araç çubuğu düğmesini alır veya ayarlar.

Item[String]
Geçersiz.

Koleksiyondan belirtilen anahtarla bir ToolBarButton alır.

Yöntemler

Name Description
Add(String)
Geçersiz.

Belirtilen Text özellik değeriyle araç çubuğu düğme koleksiyonunun sonuna yeni bir araç çubuğu düğmesi ekler.

Add(ToolBarButton)
Geçersiz.

Belirtilen araç çubuğu düğmesini araç çubuğu düğmesi koleksiyonunun sonuna ekler.

AddRange(ToolBarButton[])
Geçersiz.

Bu araç çubuğu düğme koleksiyonuna bir araç çubuğu düğmeleri koleksiyonu ekler.

Clear()
Geçersiz.

Araç çubuğu düğme koleksiyonundaki tüm düğmeleri kaldırır.

Contains(ToolBarButton)
Geçersiz.

Belirtilen araç çubuğu düğmesinin koleksiyonun bir üyesi olup olmadığını belirler.

ContainsKey(String)
Geçersiz.

Belirtilen anahtara sahip bir ToolBarButton öğesinin koleksiyonda yer alan olup olmadığını belirler.

Equals(Object)
Geçersiz.

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetEnumerator()
Geçersiz.

Araç çubuğu düğmesi koleksiyonunda yinelemek için kullanılabilecek bir numaralandırıcı döndürür.

GetHashCode()
Geçersiz.

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()
Geçersiz.

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
IndexOf(ToolBarButton)
Geçersiz.

Koleksiyonda belirtilen araç çubuğu düğmesinin dizinini alır.

IndexOfKey(String)
Geçersiz.

Belirtilen anahtara sahip bir ToolBarButton öğesinin ilk oluşumunun dizinini alır.

Insert(Int32, ToolBarButton)
Geçersiz.

Belirtilen konumdaki araç çubuğu düğme koleksiyonuna var olan bir araç çubuğu düğmesi ekler.

MemberwiseClone()
Geçersiz.

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
Remove(ToolBarButton)
Geçersiz.

Araç çubuğu düğme koleksiyonundan belirli bir düğmeyi kaldırır.

RemoveAt(Int32)
Geçersiz.

Araç çubuğu düğme koleksiyonundan belirli bir düğmeyi kaldırır.

RemoveByKey(String)
Geçersiz.

ToolBarButton belirtilen anahtarla öğesini koleksiyondan kaldırır.

ToString()
Geçersiz.

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

Name Description
ICollection.CopyTo(Array, Int32)
Geçersiz.

ICollection öğelerini belirli bir Array dizininden başlayarak bir Arraykopyalar.

ICollection.IsSynchronized
Geçersiz.

Koleksiyona erişimin eşitlenip eşitlenmediğini belirten bir değer alır (iş parçacığı güvenli).

ICollection.SyncRoot
Geçersiz.

Düğme koleksiyonuna erişimi eşitlemek için kullanılabilecek bir nesne alır.

IList.Add(Object)
Geçersiz.

Belirtilen araç çubuğu düğmesini araç çubuğu düğmesi koleksiyonunun sonuna ekler.

IList.Contains(Object)
Geçersiz.

Koleksiyonun belirli bir değer içerip içermediğini belirler.

IList.IndexOf(Object)
Geçersiz.

Koleksiyondaki belirli bir öğenin dizinini belirler.

IList.Insert(Int32, Object)
Geçersiz.

Belirtilen konumdaki araç çubuğu düğme koleksiyonuna var olan bir araç çubuğu düğmesi ekler.

IList.IsFixedSize
Geçersiz.

Koleksiyonun sabit bir boyutu olup olmadığını belirten bir değer alır.

IList.Item[Int32]
Geçersiz.

Öğeyi belirtilen dizinde alır veya ayarlar.

IList.Remove(Object)
Geçersiz.

Bir öğenin koleksiyondaki ilk oluşumunu kaldırır.

Uzantı Metotları

Name Description
AsParallel(IEnumerable)
Geçersiz.

Sorgunun paralelleştirilmesini etkinleştirir.

AsQueryable(IEnumerable)
Geçersiz.

bir IEnumerable öğesine IQueryabledönüştürür.

Cast<TResult>(IEnumerable)
Geçersiz.

öğesinin IEnumerable öğelerini belirtilen türe yazar.

OfType<TResult>(IEnumerable)
Geçersiz.

Belirtilen türe göre bir IEnumerable öğesinin öğelerini filtreler.

Şunlara uygulanır

Ayrıca bkz.