ContextNodeCollection.IndexOf 方法 (ContextNode)

返回特定 ContextNode 对象在 ContextNodeCollection 中的索引。

命名空间:  System.Windows.Ink
程序集:  IAWinFX(在 IAWinFX.dll 中)

语法

声明
Public Function IndexOf ( _
    node As ContextNode _
) As Integer
用法
Dim instance As ContextNodeCollection
Dim node As ContextNode
Dim returnValue As Integer

returnValue = instance.IndexOf(node)
public int IndexOf(
    ContextNode node
)
public:
int IndexOf(
    ContextNode^ node
)
public int IndexOf(
    ContextNode node
)
public function IndexOf(
    node : ContextNode
) : int

参数

返回值

类型:System.Int32
特定 ContextNode 对象在 ContextNodeCollection 中的索引位置。

备注

如果传入的 ContextNode 对象尚未存在于 ContextNodeCollection 集合中,则 IndexOf 返回 -1。

示例

下面的示例演示如何查找可能包含于 ContextNodeCollection(名为 nodes)中的名为 myNode 的特定 ContextNode 的索引。

Dim index As Integer = nodes.IndexOf(myNode)
int index = nodes.IndexOf(myNode);

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ContextNodeCollection 类

ContextNodeCollection 成员

IndexOf 重载

System.Windows.Ink 命名空间