Preface
What is Visual Studio.NET
Visual Studio .NET is a complete set of development tools for building ASP Web applications, XML Web services, desktop applications, and mobile applications. Visual Basic .NET, Visual C++ .NET, and Visual C# .NET all use the same integrated development environment (IDE), which allows them to share tools and facilitates in the creation of mixed-language solutions.
The .NET Framework
It is important to understand how the .NET framework operates. In order for a .NET application to run on any computer the framework must be installed. The .NET Framework is a multi-language environment for building, deploying, and running XML Web services and applications.
Common Language Runtime is a new concept on how programs run. The basic idea behind this is that it does not matter if you use VB, C++, or C# the program is going to be compiled and run the exact same way.
VB Layout
Understanding the layout of Visual Basic is essential for this tutorial because many of the objects identified here will be referred to throughout this tutorial.
Open Visual Studio.NET (Start --> Programs --> Microsoft Applications --> Visual Studio.NET)
Your screen should look similar to the one pictured below.
http://www.iupui.edu/~stc/Train/Onco...ing_screen.gif
Select the VB Projects folder. We are going to build a Windows Application so select that from the box and click Open. Your screen should look similar to the screen below.
Explorer Window
This window is used for managing forms and code for your project.
Properties Window
This window contains attributes to each object in your project.
Toolbox
The toolbox contains objects that you can use within your project. You will need to mouse over the toolbar text for the box to expand.
http://www.iupui.edu/~stc/Train/Onco.../VB/layout.gif
Lets Begin!
You should have a blank project open now. First, we are going to be adding the objects we need for this program to the form.
Expand your toolbox and drag the following items to your form:
2 Labels
1 TextBox
2 Buttons
1 ListBox
Position your objects on the form like the picture below.
HINT: To Resize and move objects try clicking on them.
http://www.iupui.edu/~stc/Train/Onco...s/VB/Step1.gif
Next we are going to change some attributes on the Properties Window to our objects. Remember to use the Properties Window.
Click on an object and change the following object attributes:
(Be sure to scroll through the list to find what you are looking for)
Form1
Name: frmList
Text: Name List
Label1
Name: lblTitle
Text: Name Listing
Font: 22pt Size
Label2
Name: lblName
Text: Name
ListBox
Name: lstNames
Button1
Name: btnSubmit
Text: Submit
Button2
Name: btnClear
Text: Clear List
TextBox
Name: txtName
Text: (delete contents)
Now that we have the form visually laid out, it is time to make this program do something with code!
Double click the submit button you put on your form. This should open the coding window. The picture below shows the code needed and an explaination of the code blocks
http://www.iupui.edu/~stc/Train/Onco...s/VB/step3.gif
Click the tab at the top that says Design
Next Double click the Clear List Button and add the code below to it's event as before
http://www.iupui.edu/~stc/Train/Onco...s/VB/step4.gif
Running Your Program
The final step is running your program to ensure everything works.
On the top menu bar select Build --> Build Solution
You will be prompted to save your program select YES if you wish to do so.
Warning: DO NOT rename your form if prompted, it will display an error message!
If all these steps were followed your program should work as expected. If you encounter error messages you may need to go back through this tutorial and make sure you did not miss a step.
http://www.iupui.edu/~stc/Train/Onco...s/VB/final.gif
If everything works properly then Congratulations on Building your VB Program!!
Tutorial Written by:
Ryan Wischmeyer, 2003
Indianapolis, IN