다음을 통해 공유


DesignerVerbCollection.IndexOf(DesignerVerb) 메서드

정의

지정된 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입니다.

예제

다음 코드 예제에서는 에서 의 존재에 대 한 DesignerVerb 테스트 하는 방법을 보여 줍니다.DesignerVerbCollection

// 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

적용 대상