Share via


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)
Available in Sandboxed Solutions: No

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