Visual Basic: Beginner Tutorial
Visual Basic is a programming language developed and owned by Microsoft. The language creates applications from small games in hand-held devices to large corporate Intranet networks of information. Learning the Visual Basic language is best done with either Microsoft's full-blown developer environment Visual Studio.NET or the free limited version Visual Basic Express, available as a free download at Microsoft.com. Any Visual Basic application that creates a user interface, displays messages or accepts information is a good place to start.
Things You'll Need
- Microsoft Visual Studio.NET installed on a PC
- Microsoft Visual Basic Express installed on a PC (optional)
Instructions
-
-
1
Open your developer environment. Click on "File" and then "New Project." A window opens for you to choose the type of project to work with. Click on "Windows Form Application." Type the name of your project in the "Name" box below and click "OK" when you finish.
-
2
Click on "View" from the top menu choices and choose "Tool Box." Scroll through the "Tool Box" and select a "Text Box." Click and drag it to the center of the blank form to your right.
-
-
3
Click and drag a "Button" from the "Tool Box" and place it beneath the "Text Box."
-
4
Click one time on the "Button" and navigate to the "Properties" tab on the right hand portion of your screen. Scroll through the "Properties" tab to find the "Text" field. Delete the default text and type "Display." Hit your "Enter" key when you finish.
-
5
Double-click the "Display" button to take you to the code page. Type "TextBox1.text = "This is really cool!"" without the outer quotations marks between the "Private Sub" and "End Sub" notations.
-
6
Press the small "green arrow" pointing to the right in the upper choices of icons to run your program. The program will appear as a standalone application. Click on the "Display" button and the message should appear in the "Text Box."
-
7
Press "File" along the top menu choices and choose "Save all files." Close your developer environment.
-
1
Tips & Warnings
Typing "me" and then a period after the word "me" will populate a list of objects you've placed in the form already. For example, when you type the "me" with the period after it, Visual Basic will display, "me.TextBox1" for you to choose from. Pressing the "Tab" key on your keyboard will choose it for you to reduce the amount of typing you need to do.
If you type any code incorrectly, Visual Basic will highlight your errors in red, green or blue squiggly lines. These errors must be fixed prior to running your application.
References
- Photo Credit trade and balance folder image by Alexey Klementiev from Fotolia.com