Lesson 1: Introduction to VB2019

A comprehensive guide to getting started with Visual Basic 2019 development

Key Takeaway: Visual Basic 2019 is part of Microsoft's Visual Studio 2019 ecosystem. This tutorial will guide you through installing VS2019 and creating your first application.

1.1 Introduction

Microsoft has released Visual Studio 2019 in early 2019. VS 2019 allows you to code in different programming languages and different platforms, Visual Basic 2019 is one of them. The other Programming languages are C# C++, F#, JavaScript, Java and Python. Visual Basic 2019 is the latest version VB.NET programming language released by Microsoft.

Visual Studio 2019 installer can be downloaded from the link below.

https://visualstudio.microsoft.com/vs/

Free Community Edition

VS2019 offers a free Community Edition with all essential features for learning and development.

Cross-Platform

Develop applications for Windows, web, cloud, mobile, games, and IoT devices.

Key features of Visual Studio 2019:

  • Improved IntelliSense: Smarter code suggestions and completions
  • Enhanced Debugging: Powerful debugging tools for complex applications
  • Live Share: Real-time collaborative coding
  • CodeLens: Insights into code history and references

1.2 Visual Studio 2019 Start Page

The VS2019 start page is quite different from VS 2017. When you first launch Visual Studio 2019, the following start Page appears, as shown in Figure 1.1. You can quickly launch recently open recently opened projects, clone from GitHub, open a project or solution, open a local folder or create a new project.

Visual Studio 2019 Start Page
Figure 1.1: Visual Studio 2019 Start Page

Let's select Create a new project option and launch the Create a new project page, as shown in Figure 1.2. We select the Visual Basic language

Visual Studio 2019 New Project Page
Figure 1.2: New Project Page

In the Create new project page, we select Windows Forms App(.Net Framework)template as we want to develop a Windows desktop project, as shown in Figure 1.3

Visual Studio 2019 Project Templates
Figure 1.3: Select Project Template

Upon clicking the selected project template, the project configuration page appears, as shown in Figure 1.4. You can configure your project by typing the project name and select a few other options.

Visual Studio 2019 Project Configuration
Figure 1.4: Configuring Project

1.3 Visual Basic 2019 IDE

Upon clicking the Create button the Visual Basic 2019 IDE, as shown in Figure 1.5. You can see that the name of the project you entered earlier appears on the top right corner of the IDE.

Visual Basic 2019 Integrated Development Environment
Figure 1.5: Visual Basic 2019 IDE

IDE Components

VB2019 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 allow a programmer to develop his or her Visual Basic 2019 program. The toolbox can be hidden or dragged to the bottom or side of the window.

Creating Your First VB2019 Application

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

First Visual Basic 2019 Application Design
Figure 1.6: The Design Interface

Click on the Display Hidden Message button to bring up the code window and enter the following statement between Private Sub and End Sub procedure, as shown in Figure 1.7

Button1.vb
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    MsgBox("Welcome to Visual Basic 2019")
End Sub
Visual Basic 2019 Code Window
Figure 1.7: Visual Basic 2019 Code Window

When you run this program and click on the Display Hidden Message button, you should get the following popup message box.

Message Box in Visual Basic 2019
Figure 1.8: The Message Box

Understanding the Code: The MsgBox function is a built-in function of Visual Basic 2019 and it will display the text enclosed within the brackets. This simple example demonstrates event handling - the code executes when the button is clicked.

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

Lesson Summary

In this introductory lesson, we've covered the fundamentals of getting started with Visual Basic 2019:

Installation

Downloaded and installed Visual Studio 2019 Community Edition

Project Setup

Created a new Windows Forms App (.NET Framework) project

IDE Familiarization

Explored the Visual Basic 2019 development environment

First Application

Designed a simple UI and wrote your first VB2019 code

You've successfully created a functional Visual Basic 2019 application that demonstrates fundamental concepts of Windows Forms development and event handling.

Related Resources

VB6 Tutorial

Mastering VB6 Programming

Explore Tutorials

Visual Basic Examples

Practical VB code samples for real-world applications

View Examples

Excel VBA Tutorial

Learn how to automate Excel by creating VBA macros

Learn More

Featured Books

Enhance your learning with these comprehensive Visual Basic guides: