Notepad: Part 1: Designing the form

The application which is being executed
The form with one of the menus dropped down
The form with one of the menus dropped down

Open Microsoft Visual Studio 2010.

  1. Click on File, then on New Project
  2. Select Visual Basic project and select Windows Form Application
  3. You’ll see a form appear.

Now, you will have to design the form.

  1. Select a richtextbox and draw one in the form. On the bottom right hand side of the VS 2010 window, there will be a properties window.  In properties, go to multiline. It will be false. Set it to true. Now select a menustrip from the toolbox. Place it above the textbox. Change the anchor property to Top, Left, Right, Bottom.
  2. You will be given a field to write in. Write the name of a menu, say, File. Press enter. You will get another field. Continue entering menu Edit, Format, View and Help. To create a shortcut for a particular menu, go into the properties for that menu and find the shortcut property of that menu. After clicking on it, you will have various choices of shortcuts. To create an underline for a letter of a menu, like, to underline F of File, just insert & before the letter. For example, &File will underline F.
  3. Now, you will need to add various other controls from the toolbox. These are: openFileDialog, SaveFileDialog, PrintDialog, StatusStrip, FontDialog, ColorDialog, PageSetupDialog and help.
  4. You will find all these controls in the toolbox. Double click all of them, they will go the bottom of the form. This is so because they are invisible controls. They cannot be placed on your actual form. These boxes are useful when you want to do functions like saving a file or opening one or printing, as their names suggest.
  5. Now for the sub-menus.  Click File. Under that, you will be given a field to type in. Type each sub-menu and press enter. To create a line separator,  click the arrow on the right side of the field where you write the name of the sub-menu and click on separator.
  6. Open up notepad, and type in the sub-menus exactly as you see them and also add the same shortcuts. Under view, add an extra sub-menu, Colour.
  7. Under View, click the status bar sub-menu. Go to its properties and change the property “Check on Click” to true.
  8. With this, we finish designing our form. Now for the coding part.

Some important notes:-

  • Give meaningful names to all the tools that you have used in your form.
  • For example, give New a name, menuNew and so on.
  • To include a status bar in your form, click on the small arrow on the right of the status strip field and select status bar. Give it a name SB.
  • The name property will be the very first property in the properties tab.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s