VB2019 VB2017 VB2015 VB2013 VB2012 VB2010 VB2008 VB6 VB Sample Code 中文VB About Us

Lesson 1 :Introduction to VB2012

1.1 Introduction

Visual Basic Express 2012 is the version of Visual Basic.Net launched by Microsoft in 2012. Visual Basic Express 2012 is almost similar to Visual Basic Express 2010 and Visual Basic 2008, but it has added some new features. The most distinct difference is that Visual Basic Express 2012 no more comes as a stand alone program, it is now bundled with other Microsoft Programming languages C# and C++ in a Integrated Development Environment (IDE) called Visual Studio 2012.

Although Microsoft has released the latest Visual Studio 2017, the older versions of Visual Studio are still available for download. To download Visual Studio 2012, click on the link below:

Older Versions Microsoft Visual Studio.

When you click on the Visual Studio download link, the following webpage appear,as shown in Figure 1.1. Scroll to Visual Studio 2012 and click download.

Older version of visual studio
Figure 1.1

After selecting Visual Studio 2012 and click the download button, you will be directed to a webpage that shows a list of Visual Studio 2012 products, as shown in Figure 1.2. As we are learning Visual Basic 2012 progamming for Windows Desktop, therfore, just select the free Visual Studio Express 2012 for Windows Desktop and click the download button. Install Visual Studio Express 2012 after the download is completed.

Visual Studio 2012 Download Cente
Figure 1.2 Visual Studio 2012 Download Center

Like Visual Basic Express 2010 and Visual Basic Express 2008 , Visual Basic Express 2012 is also a full fledged Object-Oriented Programming(OOP) Language implemented on the VB.NET framework. The Integrated Development Environment when you launch VB2012 Express is shown in the Figure 1.3.

visual studio start page
Figure 1.3 Visual Studio 2012 Start Page

1.2 Starting a New VB2012 Project

To start a new Visual Studio Express 2012 project, simply click on New Project to launched The Visual Studio New Project page as shown in Figure 1.4

Visual Studio 2012 Project Page
Figure 1.4 Visual Studio 2012 Project Page

The New Project Page comprises three templates, Visual Basic, Visual C# and Visual C++. Since we are going to learn Visual Basic 2012, we shall select Visual Basic. Visual Basic 2012 offers you four types of projects that you can create. As we are going to learn to create windows Applications, we will select Windows Forms Application. At the bottom of this dialog box, you can change the default project name WindowsApplication1 to some other name you like, for example, MyFirstProgram. After you have renamed the project, click OK to continue. The following IDE Windows will appear, it is similar to Visual Basic 2010. as shown in Figure 1.5.

Visual Basic Express 2012 IDE comprises a few windows, the Form window , the Solution Explorer window and the Properties window . It also consists of a toolbox which contains many useful controls that allows a programmer to develop his or her VB programs.

Figure 1.5 Visual Basic 2012 IDE

The Toolbox is not shown until you click on the Toolbox tab. When you click on the Toolbox tab, the common controls Toolbox will appear, as show in Figure 1.6.

Visual Basic 2012 toolbox
Figure 1.6: Visual Basic 2012 Toolbox

1.3 Creating Your First Program

Now, we shall proceed to show you how to create your first program. First, change the text of the form to My First Program in the properties window, it will appear as the title of the program. Next, insert a button and change its text to OK. The design interface is shown in Figure 1.7.

Figure 1.7: The Design Interface

Next, click on the OK button to bring up the code window and enter the following statement between Private Sub and End Sub procedure, as shown in Figure 1.8.

  MsgBox("My First Visual Basic 2012 Program")

Figure 1.8 The Code Window

Now click on the Start on the toolbar to run the program then click on the OK button, a dialog box that displays the "My First Visual Basic 2012 Program" message will appear,as shown in Figure 1.9

Figure 1.9 The Message Box

The function MsgBox is a built-in function of Visual Basic 2012 and it will display the text enclosed within the brackets.

Now you have created your first program, we shall learn more VB2012 programming techniques in coming lessons.

❮ Home Next Lesson ❯

Copyright©2008 Dr.Liew Voon Kiong. All rights reserved |Contact|Privacy Policy