ListViewGroupCollection.Contains(ListViewGroup) 方法

定義

判斷指定的群組是否位於集合中。

public:
 bool Contains(System::Windows::Forms::ListViewGroup ^ value);
public bool Contains (System.Windows.Forms.ListViewGroup value);
member this.Contains : System.Windows.Forms.ListViewGroup -> bool
Public Function Contains (value As ListViewGroup) As Boolean

參數

value
ListViewGroup

要在集合中尋找的 ListViewGroup

傳回

Boolean

如果群組位在集合中則為 true,否則為 false

備註

您無法多次將 加入 ListViewGroup 至集合。 不過,嘗試新增另一個複本並不會擲回例外狀況。 相反地,新增作業只會失敗。 在此情況下,方法 Add 會傳回 -1 的值。 不過, AddRangeInsert 方法沒有傳回值。 使用其中一種方法新增群組時,請使用 Contains 方法來判斷特定 ListViewGroup 是否已經在集合中。

適用於

另請參閱