共用方式為


ContextLinkBaseCollection.IndexOf 方法

傳回 ContextLinkBaseCollection 內特定 ContextLinkBase 物件的索引。

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

語法

'宣告
Public Function IndexOf ( _
    link As ContextLinkBase _
) As Integer
'用途
Dim instance As ContextLinkBaseCollection
Dim link As ContextLinkBase
Dim returnValue As Integer

returnValue = instance.IndexOf(link)
public int IndexOf(
    ContextLinkBase link
)
public:
int IndexOf(
    ContextLinkBase^ link
)
public int IndexOf(
    ContextLinkBase link
)
public function IndexOf(
    link : ContextLinkBase
) : int

參數

傳回值

型別:System.Int32
ContextLinkBaseCollection 內特定 ContextLinkBase 物件的索引。

備註

如果傳入 ContextLinkBaseCollection 集合內沒有的 ContextLinkBase 物件,這個方法會傳回 -1。

範例

下列範例說明如何尋找特定 ContextLinkBase (名為 myLink) 的索引,其可能包含在 ContextLinkBaseCollection (名為 links) 內。

Dim index As Integer = links.IndexOf(myLink)
int index = links.IndexOf(myLink);

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

ContextLinkBaseCollection 類別

ContextLinkBaseCollection 成員

System.Windows.Ink.AnalysisCore 命名空間