MenuItem.AddMenuAt

From Xojo Documentation

Method

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

New in 2019r2

Supported for all project types and targets.

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

Notes

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

Example

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

Var editPasteSpecial As New MenuItem
editPasteSpecial.Text = "Paste Special..."
EditMenu.AddMenuAt(5, editPasteSpecial)