ToolStripItemCollection 類別

定義

代表一組 ToolStripItem 物件。

public ref class ToolStripItemCollection : System::Windows::Forms::Layout::ArrangedElementCollection, System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class ToolStripItemCollection : System.Windows.Forms.Layout.ArrangedElementCollection, System.Collections.IList
[<System.ComponentModel.ListBindable(false)>]
type ToolStripItemCollection = class
    inherit ArrangedElementCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ToolStripItemCollection
Inherits ArrangedElementCollection
Implements IList
繼承
ToolStripItemCollection
屬性
實作

備註

這些 AddRemoveRemoveAt 方法讓你能從集合中新增或移除個別控制項。 你也可以用 AddRange OR Clear 方法來新增或移除所有控制項。

你可以透過將控制項傳入ToolStripItem方法來判斷 a Contains 是否屬於集合。 要取得集合中 a ToolStripItem 位置的索引值,將控制項傳入方法。IndexOf 集合可透過呼叫 CopyTo 該方法複製到陣列中。

建構函式

名稱 Description
ToolStripItemCollection(ToolStrip, ToolStripItem[])

初始化一個新的類別實例 ToolStripItemCollection ,使用指定的容器 ToolStrip 和指定的控制項陣列 ToolStripItem

屬性

名稱 Description
Count

取得集合中的項目數目。

(繼承來源 ArrangedElementCollection)
IsReadOnly

取得值,指出 ToolStripItemCollection 是否為唯讀。

Item[Int32]

取得指定索引的項目。

Item[String]

取得指定名稱的物品。

方法

名稱 Description
Add(Image)

新增一個 ToolStripItem 顯示指定圖片到集合中。

Add(String, Image, EventHandler)

新增一個ToolStripItem顯示指定圖片和文字到集合中,並提升事件。Click

Add(String, Image)

新增一個 ToolStripItem 顯示指定圖片與文字至集合中的 a。

Add(String)

新增 a ToolStripItem ,顯示指定的文字到集合中。

Add(ToolStripItem)

將指定的項目加入集合的末尾。

AddRange(ToolStripItem[])

為集合新增一組 ToolStripItem 控制項。

AddRange(ToolStripItemCollection)

將 a ToolStripItemCollection 加入目前的收藏。

Clear()

從集合中移除所有專案。

Contains(ToolStripItem)

判定指定項目是否屬於該集合。

ContainsKey(String)

判斷集合中是否包含具有指定鍵值的項目。

CopyTo(Array, Int32)

將此集合的全部內容複製到相容的一維 Array,從目標陣列指定的索引開始。

(繼承來源 ArrangedElementCollection)
CopyTo(ToolStripItem[], Int32)

將集合複製到指定 ToolStripItem 陣列的位置。

Equals(Object)

判斷兩個 ArrangedElementCollection 實例是否相等。

(繼承來源 ArrangedElementCollection)
Find(String, Boolean)

透過項目名稱搜尋,並回傳所有相符控制項的陣列。

GetEnumerator()

回傳整個集合的列舉器。

(繼承來源 ArrangedElementCollection)
GetHashCode()

傳回這個實例的哈希碼。

(繼承來源 ArrangedElementCollection)
GetType()

取得目前實例的 Type

(繼承來源 Object)
IndexOf(ToolStripItem)

取得集合中指定項目的索引。

IndexOfKey(String)

取得集合中指定項目首次出現的索引。

Insert(Int32, ToolStripItem)

將指定項目插入指定的索引中。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
Remove(ToolStripItem)

從集合中移除指定的項目。

RemoveAt(Int32)

從集合中指定的索引中移除一個項目。

RemoveByKey(String)

移除擁有指定金鑰的項目。

ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

明確介面實作

名稱 Description
ICollection.IsSynchronized

關於此成員的描述,請參見 IsSynchronized 該物業。

(繼承來源 ArrangedElementCollection)
ICollection.SyncRoot

關於此成員的描述,請參見 SyncRoot 該物業。

(繼承來源 ArrangedElementCollection)
IList.Add(Object)

將專案加入至集合。

IList.Clear()

從集合中移除所有專案。

IList.Contains(Object)

判斷該收藏是否包含特定項目。

IList.IndexOf(Object)

決定特定項目在收藏中的位置。

IList.Insert(Int32, Object)

在指定的索引處插入一個項目。

IList.IsFixedSize

取得值,指出集合是否具有固定大小。

IList.Item[Int32]

擷取位於指定索引處的專案。

IList.Remove(Object)

從集合中移除第一個出現的指定專案。

IList.RemoveAt(Int32)

從集合中移除指定索引的項目。

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

適用於