UITestControlCollection.IndexOf 方法
搜尋指定的物件,並傳回在完整的 UITestControlCollection 內,指定之 UITestControl 第一次出現的以零起始的索引。
命名空間: Microsoft.VisualStudio.TestTools.UITesting
組件: Microsoft.VisualStudio.TestTools.UITesting (在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)
語法
'宣告
Public Function IndexOf ( _
control As UITestControl _
) As Integer
public int IndexOf(
UITestControl control
)
public:
int IndexOf(
UITestControl^ control
)
member IndexOf :
control:UITestControl -> int
public function IndexOf(
control : UITestControl
) : int
參數
- control
型別:Microsoft.VisualStudio.TestTools.UITesting.UITestControl
要在 UITestControlCollection 中尋找的 UITestControl。
傳回值
型別:System.Int32
如果在完整的 UITestControlCollection 中找到的話,則為 control 的第一個符合項目之以零起始的索引,否則為 -1。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。