語言

ToolboxItemCollection.Contains(ToolboxItem) 方法

定義

表示集合是否包含指定的 ToolboxItem。

public:
 bool Contains(System::Drawing::Design::ToolboxItem ^ value);
public bool Contains(System.Drawing.Design.ToolboxItem value);
member this.Contains : System.Drawing.Design.ToolboxItem -> bool
Public Function Contains (value As ToolboxItem) As Boolean

參數

value
ToolboxItem

ToolboxItem A,可以搜尋這個收藏。

傳回

true若集合包含指定的物件;否則,。 false

範例

以下程式碼範例展示了使用 Contains 的方法 ToolboxItemCollection。

// If the collection contains the specified ToolboxItem, 
// retrieve the collection index of the specified item.
int indx = -1;
if ( collection->Contains( item ) )
   indx = collection->IndexOf( item );
// If the collection contains the specified ToolboxItem, 
// retrieve the collection index of the specified item.
int indx = -1;
if( collection.Contains( item ) )
    indx = collection.IndexOf( item );
' If the collection contains the specified ToolboxItem, 
' retrieve the collection index of the specified item.
Dim indx As Integer = -1
If collection.Contains(item) Then
    indx = collection.IndexOf(item)
End If

適用於