Computer Programming

Computer Programming » A Generic Computer Program » Starting a New Program

Starting a New Program

To develop a Visual Basic program, you will need to download and install Visual Basic from the Microsoft website. The Express version is freely downloadable and usable for educational purposes such as learning to program. You will need a Windows based computer as Visual Basic is not available for the Macintosh or Linux platforms. Follow the instructions to download and to install. The easiest way to install is to simply accept the defaults which are suitable for most people.

To start Visual Basic, navigate to the program, under the Microsoft Visual Basic Express folder, and select Microsoft Visual Basic Express. As Microsoft makes continual updates to its software, the version you are able to download may change, but as most of this book relies on the most straightforward features, much if not all of the information presented here would continue to be accurate.

It is important to recognize that Visual Basic is the name of the programming language, meaning the words that are put together to instruct the computer how to do what you want it to do, and is also the name of the application that takes the instructions written in the Visual Basic language and converts it into an application which you can distribute to people to run on their own computers. This book will try to be specific when it is unclear if the use of the phrase Visual Basic applies to the language or to the application.

The Start Page of the Visual Basic application allows the programmer to select a new project or to continue on working on an existing project. The instructions are written in an English-like manner, and are saved into a file, similarly to how text is written into a word processor and then saved into a file, often referred to as a document. The file of instructions is referred to as a program. For convenience, the instructions can be written across several files, all together referred to as a project. While we will not be using multiple files, we will still refer to it as a project. We will start by selecting New Project.

The default project will be a Windows Form Application, which is exactly what we are looking to build. We can accept all of the defaults for the new project.

The name will be WindowsApplication1, which you will find at the very bottom of the Start Page.

The project will be saved in a default location, namely in My Documents under a folder called Visual Studio 2010 and then the subfolder Projects. It is not necessary to change the name or location. We can change the name of the actual application later and we are not stuck with this name forever.

Inside the Projects folder will eventually be a folder called WindowsApplication1, which is exactly the name we gave our project on the Start Page. If you changed the default and used a different name, that will be the name of the folder inside the Projects folder that contains your project.

In the Visual Basic application, the project has been started for us with a default window, called a Form, named Form1 upon which we can put our programming parts. Some will refer to this as a canvas upon which we draw the programming pieces. We use the Design feature of Visual Basic which gives us the means of dragging items such as buttons and pull-down lists, and boxes in which people can type in text, onto the form. While much programming is done by expressing instructions to the computer using an English-like language, there are tools that can be used to simplify the process of writing a program. The Design tool will construct for us the instructions to create these pieces, minimizing the number of instructions we have to write. This allows us to produce a nice looking application faster than if we had to write all the instructions ourselves.

The name Form1 is found all over our project, as the name of the form called Form1, the name that shows up as the name of the Design tab called Form1.vb, and also in the Solutions Explorer called Form1.vb and many places in the Properties section.

The name Form1 is the name of the programming piece and it is also what we happen to display in the title bar of the window when the program is run.

To trial run the program, locate what looks like a play button, the triagle with the tip pointing to the right. Clicking on the run button will cause Visual Basic to generate the instructions for building an application that looks like what you drew, and also takes any additional instructions you wrote, and mixes them together to build your application.

⇐ Prev Chapter
You are on the first chapter

Next Chapter ⇒
Changing the title of the window

Computer Programming for Everyday People
Michael Bigrigg

Amazon eBook

Powered by w3.css