MenuItemStyleCollection.IndexOf(MenuItemStyle) Method

Definition

Determines the index of the specified MenuItemStyle object in the collection.

C#
public int IndexOf(System.Web.UI.WebControls.MenuItemStyle style);

Parameters

style
MenuItemStyle

The MenuItemStyle to locate.

Returns

The zero-based index of the first occurrence of the specified MenuItemStyle, if found; otherwise, -1.

Remarks

Use the IndexOf method to determine the zero-based index of the specified MenuItemStyle object in the collection. If the node is not in the collection, the method returns -1.

Note

If the specified MenuItemStyle object appears multiple times in the collection, the index of the first occurrence is returned.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also