Beginner Visual Basic 2008 Tutorial
While many originally scoffed at the Visual Basic programming language, Microsoft has developed it into a robust programming language. With its inclusion in Visual Studio, it is now a powerful Integrated Development Environment (IDE). Visual Basic is relatively easy to learn, and you can produce an application in a short period of time.
Instructions
-
Visual Basic Tutorial
-
1
Download and install Visual Basic Express from Microsoft (unless you already have a copy). The most inexpensive way to learn VB is to download and install the Express version, which is free. The setup will take a few minutes, but when it is finished, you will have Visual Basic, the .Net framework, and possibly SQL Express installed on your machine. All of this is to support your new programming environment. The 2010 version is the most current. The download/install gives you a 30-day trial. If you want to use it longer than that, register your download with Microsoft.
-
2
Open Visual Basic Express, and a screen will open to you with several windows, and a large Start Page taking most of the screen. To start a new project, click on 'Create a Project'. This will open to you the design window, with a blank form in the design area. You are now ready to begin building your application.
-
-
3
See a collapsed Toolbox window on the left. Clicking on this will open the Toolbox, from which you may select components (buttons, textboxes, labels, and a long assortment of objects) to use in your design. Double-click on a button component, and a button will be placed on your form. Select the components to match your program design. When you have finished selecting components, you will need to arrange them on the form in a way that makes sense.
-
4
Change their names and displayed text to something meaningful, once you have arranged them on the screen. For instance, if you have a button on the form that will calculate, you want it to say 'Calculate' rather than 'Button1' (the default). To make these changes, use the Properties Window, which is typically on the lower right of the screen. Single-click on the component you wish to modify, and then scroll down in the Properties Window until you find the Name property, and change it to a meaningful name (CalculateButton). Then scroll down until you find the Text property, and change it to 'Calculate'. You can do this for all components on the form. This will become very important when you begin coding.
-
5
Double-click on a component to write the code that you want to execute. The Code Window will open for you, with your cursor on the line after the first line of your button-click sub procedure. Now you can start coding according to the syntax rules of Visual Basic. Fortunately, Intellisense will help you out with that. As you start keying, Intellisense offers options for filling out the rest of the line. This makes it much easier and faster to construct code statements.
-
6
Click on the Debug menu item at the top of the screen when you have your statements coded and then click Start Debugging. This will bring your application up for you to test. Visual Basic offers several testing modes, including step-through, which will allow you to walk through a statement at a time. This is where you figure out what works and what doesn't.
-
1
References
Resources
- Photo Credit man finger on the enter key. image by mashe from Fotolia.com