共用方式為


ContextNodeBaseCollection.IndexOf 方法 (ContextNodeBase)

傳回 ContextNodeBaseCollection 內特定 ContextNodeBase 物件的索引。

命名空間:  System.Windows.Ink.AnalysisCore
組件:  IACore (在 IACore.dll 中)

語法

'宣告
Public Function IndexOf ( _
    node As ContextNodeBase _
) As Integer
'用途
Dim instance As ContextNodeBaseCollection
Dim node As ContextNodeBase
Dim returnValue As Integer

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

參數

傳回值

型別:System.Int32
ContextNodeBaseCollection 內特定 ContextNodeBase 物件的索引。

備註

如果傳入的 ContextNodeBase 物件不存在 ContextNodeBaseCollection 中,則這個方法會傳回 -1。

範例

下列範例說明如何尋找特定 ContextNodeBase (myNode) 的索引,其可能包含在 ContextNodeBaseCollection (名為 nodes) 內。

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

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

ContextNodeBaseCollection 類別

ContextNodeBaseCollection 成員

IndexOf 多載

System.Windows.Ink.AnalysisCore 命名空間