MenuItemCollection.Replace method

Replaces the first instance of the first MenuItem parameter with the second MenuItem parameter.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub Replace ( _
    oldMenuItem As MenuItem, _
    newMenuItem As MenuItem _
)
'Usage
Dim instance As MenuItemCollection
Dim oldMenuItem As MenuItem
Dim newMenuItem As MenuItem

instance.Replace(oldMenuItem, newMenuItem)
public void Replace(
    MenuItem oldMenuItem,
    MenuItem newMenuItem
)

Parameters

Remarks

The Replace method will add the newMenuItem object to the end of the menu if the first oldMenuItem object does not exist.

See also

Reference

MenuItemCollection class

MenuItemCollection members

Microsoft.SharePoint.WebPartPages namespace