- Open Visual studio and make a new Visual C# project. I named it as Notepad
- After the project is created, click on the form and go to propeties. Change the Text as Notepad.
- Now you can see your form name changed to Form1 as Notepad
- Then drag and drop a MenuStrip
- Add Menus, File and Edit
- Add sub Menus
- File
- New
- Open
- Save
- Exit
- Edit
- Undo
- Redo
- Cut
- Copy
- Past
- Select All
When you adding the menus and submenus, goto
propeties -> Text change the name of menus and submenu by adding "&" mark to the front of the name.As a example change
New as
&New
Reason for this is ,open the notepad in your windows computer press
Alt button. You can see it's manus are changing. That mean, the first letter is underlined.
When you press the underlined letter's key by using key board that manu item will working.
So add the & for all the menu and submenu items.
Do not need add & mark
front of the
Text. If it is there were two items start with same letter you can choose another letter.As a example for the
Cut and CopyI use
y for
Copy
Now you can run your project and check if it is working.
- You can add separator to separate the submenu items.
- Right click on where you want to add the separator. insert -> Separator
Next time we will see how add images to the menu items and how create a short cut keys to the menu items.