From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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

New in 2021r3

Supported for all project types and targets.

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


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


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 DesktopMenuItem
editPasteSpecial.Text = "Paste Special..."
EditMenu.AddMenuAt(5, editPasteSpecial)