Thanks for spotting this. The example was wrong, and I’ve corrected the documentation for the next release (the docs get pushed automatically with each new build).
In a new Studio desktop project, Studio already assigns MainMenuBar to App.MenuBar and opens the default Window1. In the meantime, remove the Self.MenuBar = MainMenuBar.CreateForApp(Self) line and the two lines that create and show Window1. You don’t need an Opening event just to set up the default menu and window.
CreateForApp(Self) is available only when the menu bar has an App-owned event handler configured in the designer. If you explicitly need another instance without those handlers, use MainMenuBar.Create().
I’ve tracked the documentation correction here.