StyleCollection.IndexOf(Style) 方法

定义

返回指定的 Style 对象在集合中的索引。Returns the index of the specified Style object within the collection.

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

参数

style
Style

要在集合中定位的 StyleThe Style to locate within the collection.

返回

Int32

style 在集合中的第一个匹配项的从零开始的索引;否则,如果样式不在集合中,则为 -1。The zero-based index of the first occurrence of style within the collection; otherwise, -1 if the style is not in the collection.

注解

Contains方法通过对对象使用方法来确定相等性 Equals StyleThe Contains method determines equality by using the Equals method on the Style objects.

适用于