Wal Mart Online → Best Selection
Visual BasicIntroduction to VB.NET
How VB is Compiled
Start Visual Studio
Windows Form App
Save Your WorkVB OOP Programming
Visual Basic Code
Button Event CodeCoding Recommendations
Error List Window
Built-In Data Types
Declare VariablesDeclare Constants
Code Arithmetic Expressions
Math ClassString Declaration
Loop ConstructsFor Next Loop
Do While Loop
Do Until LoopDo...Loop-While
Exit Do | Exit ForDo...Loop
Rnd( ) FunctionListbox Control
Parallel ArraysKey Event Args
Dynamic ArraysRedimension Array
MultiDimensional ArraysDataGridView Control
Length and Sort Methods
Add Form To Project
Form Object Methods
Form Show Method
Form Close Method
Form Accept Button
Multiform Project Example
ASP.NET Web ProgrammingCreate Data Source
Configure Access Data Source
Add Product Class
Extract Local Database DataOrder PageLoad VB Code
Add New Web Page
Set Start PageDisplay Cart Aspx Code
Display Cart Design View
Sorted List Definition
VB.NET Session State
Create CartItem ClassGetCartContents Function
Add To Cart Event HandlerRemove Cart Item Event
Clear Cart Event Handler
Visual Basic Programming Introduction
You can use Visual Studio for developing the two types of applications:
A detailed view of the .NET Framework is given in Figure VB-1:
As you can see, the .NET Framework provides a common set of services that application programs written in a .NET language such as C# can use to run on various operating systems and hardware platforms. The .NET Framework is divided into two main components:
The .NET Framework Class Library consists of segments of pre-written code called classes that provide many of the functions that you need for developing .NET applications. For instance, the Windows Forms that you need for developing .NET applications. For instance, the Windows Forms classes are used for developing Windows Forms applications. The ASP.NET classes are used for developing Web Forms applications. And other classes let you work with databases, manage security, access files, and perform many other functions.
Although it's not apparent in this figure, the classes in the .NET Framework Class Library are organized in a hierarchical structure. Within this structure, related classes are organized into groups called namespaces. Each namespace contains the classes used to support a particular function. For example, the System.Windows.Forms namespace contains the classes you use to access data.
Figure VB-2 shows the Microsoft Visual Studio Integrated Development Environment. In practice, this IDE if often referred to as Visual Studio. Microsoft Visual Studio supports 3 languages: Visual Basic, Visual C#, and Visual C++.
Microsoft Visual Studio includes designers that can be used to design the user interface for Windows Forms and Web Forms applications. The visual tools make this tough task much easier. You'll be introduced to the designer for Windows Forms.
Visual Studio also includes an editor that can be used to work with any of the three languages presented in Figure VB-1 as well as HTML and XML. This editor contains many features that make it easy to enter and edit the code for an application.
Figure VB-3 shows how a Visual Basic program is compiled and run. To start, you use Visual Studio to create a project, which is made up of source files that contain Visual Basic statements. A project may also contain other types of files, such as sound, image or text files.
After you enter the Visual Basic code for a project, you use the Visual Basic Compiler, which is built into Visual Studio, to build or compile your Visual Basic source code into Microsoft Intermediate Language.
At this point, the Intermediate Language is stored on disk in a file that's called an assembly. In addition to the Intermediate Language, the assembly includes references to the classes that the application requires. The assembly can then be run on any PC that has the Common Language Runtime installed on it. When the assembly is run, the Common Language Runtime converts the Intermediate Language to native code that can be run by the Windows operating system.
If you have developed applications with other languages, this process should be familiar to you. If this is your first language, though, you will not really understand this process until you develop your first applications.
Incidentally, a solution is a container that can hold one or more projects. Although a solution can contain more than one project, the solution for a simple application usually contains just one project. In that case, the solution and the project are essentially the same thing.
How Visual Basic differs from the other .NET languages
Visual Basic uses the same .NET Framework classes as the other .NET programming languages. These classes affect almost every aspect of programming, including creating and working with forms and controls, using databases, and working with basic language features such as arrays and strings. In addition, Visual Basic works has many similarities to the other .NET languages. The main difference is the syntax of the language.
With all that as background, we're ready to take a tour of the Visual Studio IDE. Along the way, we'll touch on some basic techniques for working in this environment. We'll also go over how some of the terms we just went over are applied within the Integrated Development Environment.
How To Start Visual Studio
Select Start → All Programs from your Windows main screen as indicated in the diagram below:
All programs will display a list of Program folders:
When the Visual Studio program starts the Start Screen should look similar to the diagram below: