MenuItem.Insert

From Xojo Documentation

Method

MenuItem.Insert(Index as Integer, Item as MenuItem)

New in 5.0

Supported for all project types and targets.

Inserts Item as a MenuItem at the position indicated by Index. Index is zero-based.

Notes

You can insert a Separator by passing the class constant MenuItem.TextSeparator.

Example

The following example inserts a new item in the Edit menu with the text "Paste Special..." just below the Paste item.

Dim editPasteSpecial As New MenuItem
editPasteSpecial.Text = "Paste Special..."
EditMenu.Insert(5, editPasteSpecial)