MapEditor.cs
file in Solution Explorer to open the MapEditor form in the design window. exitToolStripMenuItem_Click()
event handler:game.Exit(); Application.Exit();
We now have a standard Windows menu attached to our form with a few entries for our level editor. In order to add code to menu items other than the Exit command, we need to make modifications to our Game1 class, so we will come back to them after we have laid out all of the items on our display.
What are all those ampersands?
In step two above, each of the menu item entries contains an ampersand (&) character, usually as the first character in the entry. When the MenuStrip control sees these characters, instead of displaying them in the menu, it causes the next character in the name to be underlined and treated as a shortcut key. By labelling the File menu as&File, the item will be displayed as File, and pressing Alt + F will open the File menu. Items within the File menu can then be accessed by pressing their own shortcut keys (L for Load, S for Save, and so on).
3.147.103.8