DesignerVerbCollection.IndexOf 方法
获取指定的 DesignerVerb 的索引。
**命名空间:**System.ComponentModel.Design
**程序集:**System(在 system.dll 中)
语法
声明
Public Function IndexOf ( _
value As DesignerVerb _
) As Integer
用法
Dim instance As DesignerVerbCollection
Dim value As DesignerVerb
Dim returnValue As Integer
returnValue = instance.IndexOf(value)
public int IndexOf (
DesignerVerb value
)
public:
int IndexOf (
DesignerVerb^ value
)
public int IndexOf (
DesignerVerb value
)
public function IndexOf (
value : DesignerVerb
) : int
参数
- value
要在集合中获取索引的 DesignerVerb。
返回值
指定对象的索引(如果在列表中找到);否则为 -1。
示例
' 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
// 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.
DesignerVerb^ testVerb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
int itemIndex = -1;
if ( collection->Contains( testVerb ) )
itemIndex = collection->IndexOf( testVerb );
平台
Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
DesignerVerbCollection 类
DesignerVerbCollection 成员
System.ComponentModel.Design 命名空间