StatusBar.StatusBarPanelCollection.IndexOf(StatusBarPanel) StatusBar.StatusBarPanelCollection.IndexOf(StatusBarPanel) StatusBar.StatusBarPanelCollection.IndexOf(StatusBarPanel) StatusBar.StatusBarPanelCollection.IndexOf(StatusBarPanel) Method

定义

返回指定的面板在集合中的索引。Returns the index within the collection of the specified panel.

public:
 int IndexOf(System::Windows::Forms::StatusBarPanel ^ panel);
public int IndexOf (System.Windows.Forms.StatusBarPanel panel);
member this.IndexOf : System.Windows.Forms.StatusBarPanel -> int
Public Function IndexOf (panel As StatusBarPanel) As Integer

参数

panel
StatusBarPanel StatusBarPanel StatusBarPanel StatusBarPanel

要在集合中查找的 StatusBarPanelThe StatusBarPanel to locate in the collection.

返回

面板在集合中的从零开始的索引;如果面板不在集合中,则为负一 (-1)。The zero-based index where the panel is located within the collection; otherwise, negative one (-1).

注解

使用IndexOf方法可以确定面板在集合中的位置。The IndexOf method enables you to determine where a panel is located within the collection. 若要在调用此方法之前确定项是否位于集合内, 请使用Contains方法。To determine whether an item is located within the collection before calling this method, use the Contains method.

适用于

另请参阅