DesignerVerbCollection.IndexOf(DesignerVerb) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得指定 DesignerVerb 的索引。
public:
int IndexOf(System::ComponentModel::Design::DesignerVerb ^ value);
public int IndexOf (System.ComponentModel.Design.DesignerVerb value);
public int IndexOf (System.ComponentModel.Design.DesignerVerb? value);
member this.IndexOf : System.ComponentModel.Design.DesignerVerb -> int
Public Function IndexOf (value As DesignerVerb) As Integer
參數
- value
- DesignerVerb
DesignerVerb,要在集合中取得其索引。
傳回
如果在清單中找到,則為指定物件的索引,否則為 -1。
範例
下列程式代碼範例示範如何在 中測試 是否存在DesignerVerbDesignerVerbCollection。
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb^ testVerb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
int itemIndex = -1;
if ( collection->Contains( testVerb ) )
itemIndex = collection->IndexOf( testVerb );
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
itemIndex = collection.IndexOf( testVerb );
' Tests for the presence of a DesignerVerb in the collection,
' and retrieves its index if it is found.
Dim testVerb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))
Dim itemIndex As Integer = -1
If collection.Contains(testVerb) Then
itemIndex = collection.IndexOf(testVerb)
End If