Share via


TreeNodeStyleCollection.IndexOf(TreeNodeStyle) 方法

定義

判斷集合中指定之 TreeNodeStyle 物件的索引。

public:
 int IndexOf(System::Web::UI::WebControls::TreeNodeStyle ^ style);
public int IndexOf (System.Web.UI.WebControls.TreeNodeStyle style);
member this.IndexOf : System.Web.UI.WebControls.TreeNodeStyle -> int
Public Function IndexOf (style As TreeNodeStyle) As Integer

參數

style
TreeNodeStyle

要尋找的 TreeNodeStyle

傳回

如果在 TreeNodeStyleCollection 中找到的話,則為 style 的第一個符合項目之以零起始的索引,否則為 -1。

備註

IndexOf使用 方法來判斷 物件中指定 TreeNodeStyle 物件的以零起始的 TreeNodeStyleCollection 索引。 如果節點不在集合中,方法會傳回 -1。

注意

如果集合中出現指定的 TreeNodeStyle 物件多次,則會傳回第一次出現的索引。

適用於

另請參閱