VB.NET Masterclass: Learn Visual Basic and VBScript
4.1 (155 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
18,522 students enrolled

VB.NET Masterclass: Learn Visual Basic and VBScript

Visual Basic is one of the most powerful languages created by one of the largest companies in the world, Microsoft.
4.1 (155 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
18,522 students enrolled
Created by Frahaan Hussain
Last updated 10/2018
English [Auto]
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 8 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Visual Basic programming
  • Application programming
  • Semantics of general programming
  • The format of coding applications
  • All the functions of Visual Basic programming
  • Application programming
Course content
Expand all 71 lectures 04:25:56
+ Introduction
3 lectures 09:01

Introduction to this Visual Basic course.

Preview 01:33

Learn how to setup Visual Studio on windows to program in Visual Basic.

Preview 06:06

Learn about online IDE's to be able to run Visual Basic code online.

Run Code Online
+ Basics
25 lectures 01:58:43

console refers to an interface through which users communicate with system programs of the operating system or with other console applications. The interactions consist of input operations from standard input device like keyboard and the text display on standard output ( usually on computer screen ).

Console Output

In computer programming, a comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. The syntax of comments in various programming languages varies considerably.

Comments are sometimes processed in various ways to generate documentation external to the source code itself by documentation generators, or used for integration with source code management systems and other kinds of external programming tools.


In computer programming, a variable or scalar is a storage location (identified by a memory address) paired with an associated symbolic name (an identifier), which contains some known or unknown quantity of information referred to as a value. The variable name is the usual way to reference the stored value, in addition to referring to the variable itself, depending on the context. This separation of name and content allows the name to be used independently of the exact information it represents. The identifier in computer source code can be bound to a value during run time, and the value of the variable may thus change during the course of program execution.

Variables in programming may not directly correspond to the concept of variables in mathematics. The latter is abstract, having no reference to a physical object such as storage location. The value of a computing variable is not necessarily part of an equation or formula as in mathematics. Variables in computer programming are frequently given long names to make them relatively descriptive of their use, whereas variables in mathematics often have terse, one- or two-character names for brevity in transcription and manipulation.

Preview 03:04

Reads the next line of characters from the standard input stream.

Console Input

In computer science and computer programming, a data type or simply type is a classification of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support various types of data, for example: real, integer or Boolean. A data type provides a set of values from which an expression (i.e. variable, function...) may take its values. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A type of value from which an expression may take its value.

Data Types

In computer programming, a constant is a value that cannot be altered by the program during normal execution, i.e., the value is constant. When associated with an identifier, a constant is said to be "named," although the terms "constant" and "named constant" are often used interchangeably. This is contrasted with a variable, which is an identifier with a value that can be changed during normal execution, i.e., the value is variable. Constants are useful for both programmers and compilers: for programmers they are a form of self-documenting code and allow reasoning about correctness; while for compilers they allow compile-time and run-time checks that constancy assumptions are not violated, and allow or simplify some compiler optimisations.

There are various specific realisations of the general notion of a constant, with subtle distinctions that are often overlooked. The most significant are: compile-time (statically-valued) constants, run-time (dynamically-valued) constants, immutable objects, and constant types (const).

Preview 03:11

An enumeration is a complete, ordered listing of all the items in a collection. The term is commonly used in mathematics and computer science to refer to a listing of all of the elements of a set. The precise requirements for an enumeration (for example, whether the set must be finite, or whether the list is allowed to contain repetitions) depend on the discipline of study and the context of a given problem.

Some sets can be enumerated by means of a natural ordering (such as 1, 2, 3, 4, ... for the set of positive integers), but in other cases it may be necessary to impose a (perhaps arbitrary) ordering. In some contexts, such as enumerative combinatorics, the term enumeration is used more in the sense of counting – with emphasis on determination of the number of elements that a set contains, rather than the production of an explicit listing of those elements.


Conditional compilation is typically used to compile the same program for different platforms. It is also used to prevent debugging code from appearing in an executable file. Code excluded during conditional compilation is completely omitted from the final executable file, so it has no effect on size or performance.


Operators are symbols that tell the compiler to perform specific mathematical or logical manipulations. In this tutorial , we will try to cover the most commonly used operators in programming.


The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed. The if/else statement is a part of Visual Basic's "Conditional" Statements, which are used to perform different actions based on different conditions.

Preview 04:53

In computer programming languages, a switch statement is a type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via search and map.

Switch Statement

In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number.


In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation).


Learn about date and time in Visual Basic.

Date & Time

An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the "Hello World!"

Preview 06:17

It is mainly used to traverse array or collection elements. The advantage of for-each loop is that it eliminates the possibility of bugs and makes the code more readable.

Preview 03:56

It represents an ordered collection of an object that can be indexed individually. It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using an index and the array resizes itself automatically.


Hashtable performs fast lookups from any key. It returns a previously specified value. Conceptually we add keys and values together. We then search the table instantly or remove elements. The Hashtable is an optimised lookup mechanism.


A SortedList element can be accessed by its key, like an element in any Dictionary implementation, or by its index, like an element in any List implementation.

A SortedList object internally maintains two arrays to store the elements of the list; that is, one array for the keys and another array for the associated values. Each element is a key/value pair that can be accessed as a DictionaryEntry object. A key cannot be null, but a value can be.


The capacity of a Stack is the number of elements the Stack can hold. As elements are added to a Stack, the capacity is automatically increased as required through reallocation.


In computer science, a queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position, known as enqueue, and removal of entities from the front terminal position, known as dequeue. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed. Often a peek or front operation is also entered, returning the value of the front element without dequeuing it. A queue is an example of a linear data structure, or more abstractly a sequential collection.

Queues provide services in computer science, transport, and operations research where various entities such as data, objects, persons, or events are stored and held to be processed later. In these contexts, the queue performs the function of a buffer.

Queues are common in computer programs, where they are implemented as data structures coupled with access routines, as an abstract data structure or in object-oriented languages as classes. Common implementations are circular buffers and linked lists.


Manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).


A Sub procedure is a series of Visual Basic statements enclosed by the Sub and End Sub statements. The Sub procedure performs a task and then returns control to the calling code, but it does not return a value to the calling code.

Each time the procedure is called, its statements are executed, starting with the first executable statement after the Sub statement and ending with the first End Sub, Exit Sub, or Return statement encountered.

Preview 07:28

A Function procedure is a series of Visual Basic statements enclosed by the Function and End Function statements. The Function procedure performs a task and then returns control to the calling code. When it returns control, it also returns a value to the calling code.

Each time the procedure is called, its statements run, starting with the first executable statement after the Function statement and ending with the first End Function, Exit Function, or Return statement encountered.


Provides a way to handle some or all possible errors that may occur in a given block of code, while still running code.

Exception Handling

Time to test your basic knowledge of Visual Basic, are your ready?

Quiz 1 - Basics
6 questions
+ Classes
6 lectures 27:39

In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods).

Simple Class Example

In class-based object-oriented programming, a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables.

A constructor resembles an instance method, but it differs from a method in that it has no explicit return type, it is not implicitly inherited and it usually has different rules for scope modifiers. Constructors often have the same name as the declaring class. They have the task of initializing the object's data members and of establishing the invariant of the class, failing if the invariant is invalid. A properly written constructor leaves the resulting object in a valid state. Immutable objects must be initialized in a constructor.

Preview 03:23

destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.


Shared members (which are called static or class members in some other languages) are not associated with a specific instance of a class and are thus shared by all objects that are instantiated from that class. To call a shared member, you can qualify it either with the class name or with an object of that class. Because shared members are not associated with object instances, they do not have access to non-shared members (which are accessed through "Me," which represents the current object instance).

Non-shared members are called instance members because they are associated with individual object instances. Think of shared members as belonging to the class and instance members belonging to instances of the class (that is, objects). 

Shared Properties

The scope of a variable is determined at the time the variable is declared. In Microsoft Visual Basic for Applications, the three scopes available for variables are procedure, module, and public.


The Inherits statement is used to declare a new class, called a derived class, based on an existing class, known as a base class. Derived classes inherit, and can extend, the properties, methods, events, fields, and constants defined in the base class. The following section describes some of the rules for inheritance, and the modifiers you can use to change the way classes inherit or are inherited:

  • By default, all classes are inheritable unless marked with the NotInheritable keyword. Classes can inherit from other classes in your project or from classes in other assemblies that your project references.

  • Unlike languages that allow multiple inheritance, Visual Basic allows only single inheritance in classes; that is, derived classes can have only one base class. Although multiple inheritance is not allowed in classes, classes can implement multiple interfaces, which can effectively accomplish the same ends.

  • To prevent exposing restricted items in a base class, the access type of a derived class must be equal to or more restrictive than its base class. For example, a Public class cannot inherit a Friend or a Private class, and a Friend class cannot inherit a Private class.


Time to test your knowledge of Classes & Objects

Quiz 2 - Classes & Objects
5 questions
+ File Handling
1 lecture 06:32

file represents a sequence of bytes on the disk where a group of related data is stored. File is created for permanent storage of data.

File Handling
18 lectures 01:03:33

The graphical user interface, is a type of user interface that allows users to interact with electronic devices through graphical icons and visual indicators such as secondary notation, instead of text-based user interfaces, typed command labels or text navigation.

Setup A GUI Project

An important part of Visual Basic is the ability to create Windows Forms applications that run locally on users' computers. You can use Visual Studio to create the application and user interface using Windows Forms. A Windows Forms application is built on classes from the System.Windows.Forms namespace.


TextBox control is used to display, or accept as input, a single line of text. VB.Net programmers make extensive use of the TextBox control to let the user view or enter large amount of text. A TextBox object is used to display text on a form or to get user input while a VB.Net program is running.


label in a programming language is a sequence of characters that identifies a location within source code. In most languages labels take the form of an identifier, often followed by a punctuation character (e.g., a colon).

Preview 01:45

The Button control represents a standard Windows button. It is generally used to generate a Click event by providing a handler for the Click event. Let's create a label by dragging a Button control from the Toolbox ad dropping it on the form.


A Windows Forms ListBox control displays a list from which the user can select one or more items. If the total number of items exceeds the number that can be displayed, a scroll bar is automatically added to the ListBox control. When the MultiColumn property is set to true, the list box displays items in multiple columns and a horizontal scroll bar appears. When the MultiColumn property is set to false, the list box displays items in a single column and a vertical scroll bar appears. When ScrollAlwaysVisible is set to true, the scroll bar appears regardless of the number of items. The SelectionMode property determines how many list items can be selected at a time.


The Windows Forms ComboBox control is used to display data in a drop-down combo box. By default, the ComboBox control appears in two parts: the top part is a text box that allows the user to type a list item. The second part is a list box that displays a list of items from which the user can select one. For more information on other styles of combo box, see When to Use a Windows Forms ComboBox Instead of a ListBox.

The SelectedIndex property returns an integer value that corresponds to the selected list item. You can programmatically change the selected item by changing the SelectedIndex value in code; the corresponding item in the list will appear in the text box portion of the combo box. If no item is selected, the SelectedIndex value is -1. If the first item in the list is selected, then the SelectedIndex value is 0. The SelectedItem property is similar to SelectedIndex , but returns the item itself, usually a string value. The Count property reflects the number of items in the list, and the value of the Count property is always one more than the largest possible SelectedIndex value because SelectedIndex is zero-based.

To add or delete items in a ComboBox control, use the Add, Insert, Clear or Remove method. Alternatively, you can add items to the list by using the Items property in the designer.


Windows Forms RadioButton controls present a set of two or more mutually exclusive choices to the user. While radio buttons and check boxes may appear to function similarly, there is an important difference: when a user selects a radio button, the other radio buttons in the same group cannot be selected as well. In contrast, any number of check boxes can be selected. Defining a radio button group tells the user, "Here is a set of choices from which you can choose one and only one."

Preview 03:45

The Windows Forms CheckBox control indicates whether a particular condition is on or off. It is commonly used to present a Yes/No or True/False selection to the user. You can use check box controls in groups to display multiple choices from which the user can select one or more.

The check box control is similar to the radio button control in that each is used to indicate a selection that is made by the user. They differ in that only one radio button in a group can be selected at a time. With the check box control, however, any number of check boxes may be selected.

A check box may be connected to elements in a database using simple data binding. Multiple check boxes may be grouped using the GroupBox control. This is useful for visual appearance and also for user interface design, since grouped controls can be moved around together on the form designer. For more information, see Windows Forms Data Binding and GroupBox Control.

The CheckBox control has two important properties, Checked and CheckState. The Checked property returns either true or false. The CheckState property returns either Checked or Unchecked; or, if the ThreeState property is set to true, CheckState may also return Indeterminate. In the indeterminate state, the box is displayed with a dimmed appearance to indicate the option is unavailable.


The picture that is displayed is determined by the Image property, which can be set at run time or at design time. You can alternatively specify the image by setting the ImageLocation property and then load the image synchronously using the Load method or asynchronously using the LoadAsync method. The SizeMode property controls how the image and control fit with each other. For more information, see How to: Modify the Size or Placement of a Picture at Run Time.


The Windows Forms ProgressBar control indicates the progress of a process by displaying an appropriate number of rectangles arranged in a horizontal bar. When the process is complete, the bar is filled. Progress bars are commonly used to give the user an idea of how long to wait for a process to complete; for instance, when a large file is being loaded.

Preview 03:08

Windows Forms GroupBox controls are used to provide an identifiable grouping for other controls. Typically, you use group boxes to subdivide a form by function. For example, you may have an order form that specifies mailing options such as which overnight carrier to use. Grouping all options in a group box gives the user a logical visual cue, and at design time all the controls can be moved easily — when you move the single GroupBox control, all its contained controls move, too.

The group box's caption is defined by the Text property. For more information, see How to: Set the Text Displayed by a Windows Forms Control.


The Windows Forms DateTimePicker control allows the user to select a single item from a list of dates or times. When used to represent a date, it appears in two parts: a drop-down list with a date represented in text, and a grid that appears when you click on the down-arrow next to the list. The grid looks like the MonthCalendar control, which can be used for selecting multiple dates. For more information on the MonthCalendar control, see MonthCalendar Control Overview.


With the Windows Forms TreeView control, you can display a hierarchy of nodes to users, like the way files and folders are displayed in the left pane of the Windows Explorer feature of the Windows operating system. Each node in the tree view might contain other nodes, called child nodes. You can display parent nodes, or nodes that contain child nodes, as expanded or collapsed. You can also display a tree view with check boxes next to the nodes by setting the tree view's CheckBoxes property to true. You can then programmatically select or clear nodes by setting the node's Checked property to true or false.


The Windows Forms ListView control displays a list of items with icons. You can use a list view to create a user interface like the right pane of Windows Explorer. The control has four view modes: LargeIcon, SmallIcon, List, and Details.


An event source (sometimes called an event sender) is any object that can signal the occurrence of an event. Broadcasting this signal is called raising the event. Many of the classes in the .NET Framework Class Library, as well as the user interface components in the Windows Forms and Web Forms packages, can raise events. Figure 1 shows some of the events from the System.Windows.Forms.Control class, which are generally inherited by all of the controls on a Windows Form.


The Windows Forms WebBrowser control hosts Web pages and provides Web browsing capabilities to your application.


The Windows Forms TabControl displays multiple tabs, like dividers in a notebook or labels in a set of folders in a filing cabinet. The tabs can contain pictures and other controls. Use the TabControl to create property pages.


Time to test your Graphical User Interface knowledge?

Quiz 3 - GUI
4 questions
+ Dialog Box
5 lectures 16:59

The ColorDialog component displays a palette of colors and returns a property containing the color the user has selected.

Color Dialog

The FontDialog component allows users to select a font, as well as change its display aspects, such as its weight and size.

The font selected in the dialog box is returned in the Font property. Thus, taking advantage of the font selected by the user is as easy as reading a property.

Preview 02:34

The OpenFileDialog component allows users to browse the folders of their computer or any computer on the network and select one or more files to open. The dialog box returns the path and name of the file the user selected in the dialog box.

Once the user has selected the file to be opened, there are two approaches to the mechanism of opening the file. If you prefer to work with file streams, you can create an instance of the StreamReader class. Alternately, you can use the OpenFile method to open the selected file.

Open File Dialog

The SaveFileDialog component allows users to browse the file system and select files to be saved. The dialog box returns the path and name of the file the user has selected in the dialog box. However, you must write the code to actually write the files to disk.

Save File Dialog

Lets users select a printer and choose which sections of the document to print from a Windows Forms application.

Print Dialog

Test your knowledge on dialog boxes

Quiz 4 - Dialog Box
2 questions
+ Advanced
5 lectures 23:27

Built-in menus appear on the menu bar across the top of the Visual Basic window. Each menu contains commands that relate to the menu name. For example, the Format menu contains commands used for formatting your form. Some of the commands have submenus that contains more specific commands. For example, the Toolbars command on the View menu has a submenu that contains the names of the toolbars and the Customise command. You can use the Customise command to modify the built-in menus or to add commands to the menu bar.

Preview 02:20

Anchor refers to the position a control has relative to the edges of the form. A textbox, for example, that is anchored to the left edge of a form will stay in the same position as the form is resized. Docking refers to how much space you want the control to take up on the form.

Anchoring & Docking

An important part of Visual Basic is the ability to create Windows Forms applications that run locally on users' computers. You can use Visual Studio to create the application and user interface using Windows Forms. A Windows Forms application is built on classes from the System.Windows.Forms namespace.


To use a numbered capture group, surround the group with parentheses in the regular expression pattern. Use $number, where number is an integer starting at 1, to specify a specific, numbered group in a replacement pattern. For example, the grouped regular expression (\d)([a-z]) defines two groups: the first group contains a single decimal digit, and the second group contains a single character between a and z. The expression finds four matches in the following string: 1a 2b 3c 4d. The replacement string z$1references the first group only, and converts the string to z1 z2 z3 z4.

Regular Expressions

parser is a piece of program that takes a physical representation of some data and converts it into an in-memory form for the program as a whole to use. Parsers are used everywhere in software. An XML Parser is a parser that is designed to read XML and create a way for programs to use XML.

Parsing an XML File

Advance onto one of the most advanced quizzes ever made.

Quiz 5 - Advanced
4 questions
+ Extra Learning Resources
8 lectures 00:02

Microsoft Visual Basic

Microsoft Visual Basic

the coding guys

the coding guys









University of Calgary

University of Calgary

Baylor University

Baylor University
  • Passion for learning Visual Basic
  • Basic computer knowledge and skills
  • Passion for programming
  • Basic knowledge of computer science is optional

Learn about everything there is to know about Visual Basic Applications and How To Program Them. A step by step process is used to show explain every facet of these topics.

Gain a good understanding of the following concepts with this course:

  1. What Visual Basic is?

  2. Microsoft Certifications

  3. How to program in the Visual Basic language

  4. Features of the Visual Basic programming language

  5. Coding semantics

  6. Website programming

  7. Design practises of applications

  8. Application programming

  9. Object Oriented programming

  10. Network programming

  11. Multithreading programming

Visual Basic is fast becoming a worldwide Tour De Force that is requested by all companies such as Google, Facebook and Microsoft. This course will ensure you are not left as more and more companies request this awesome language. This course will teach your everything about programming Visual Basic applications and websites.

You will receive all the knowledge to use and leverage the powerful technology behind these amazing and wonderful platforms.

Over 205,000 students have enrolled on my courses and all of them are extremely satisfied. You will also be satisfied with this course. If you do not like the course, remember that within 30 days you can request a full refundI guarantee you satisfaction.

If you have any questions regarding the topics covered in this course, please feel free to ask. I'm always happy to help those who want to learn.

To summarise this is what you get:

• Lifetime access to HD quality videos. No monthly subscription. Learn at your own pace, whenever you want.

• All videos are downloadable. Learn wherever you want, even without an internet connection!

• Downloadable starter code and final code for each section.

• Free helpful support in the course Q&A when you have questions or get stuck.

• Multiple coding challenges to practice your new skills (solutions included).

Sounds great? Then start this adventure today by clicking the “Take this course" button, and join me in the only course that you will need!

Who this course is for:
  • Anyone looking to learn about Visual Basic
  • Developers looking to learn the skills needed to acquire Microsoft Certifications
  • People looking to learn about programming
  • Those seeking to understand how Visual Basic works
  • People seeking guidance on how to create Visual Basic based programs
  • Beginners and experts in this field
  • People seeking more knowledge on the various features of the Visual Basic programming language