Visual Basic Essential Training

Visual Basic Essential Training

7h 20mBeginner2025-01-31

Authors

Walt Ritscher

Walt Ritscher

Programmer, UI Designer, Staff Instructor at LinkedIn Learning

Learn-it Labs

Learn-it Labs

Course details

Visual Basic is one of the core Microsoft languages for building desktop, mobile, and web applications. This comprehensive course was designed to help you start programming with Visual Basic using Visual Studio. Join instructor Walt Ritscher as he provides an overview of applications for three common application architectures: console, desktop, and ASP.NET apps. Along the way, discover the core concepts and technical skills required to use a variety of language fundamentals including classes, data types, operators, strings, looping constructs, conditionals, exceptions, lists, and querying data with LINQ.

Learning objectives
Use .NET classes in your application.
Declare variables and data types.
Work with numbers and dates.
Use strings.
Repeat blocks of code with loops.
Evaluate conditions with if, then, and else.
Debug and handle exceptions.
Work with lists.

Skills covered

Visual BasicEssential TrainingProgramming LanguagesMicrosoftSoftware Development

Concepts

Introduction

  • Write applications with Visual Basic
  • Choose an editor or IDE
  • Install Visual Studio and choose workloads
  • How to access the sample code on GitHub

Quick Tour

  • Visual Basic and you
  • .NET and Visual Basic
  • What can you build with Visual Basic

Build Your First Application

  • Chapter roadmap
  • Set up the tools
  • Create a console app
  • What files are in the new project
  • Build and compile the application
  • Run the application
  • Work with the console class
  • The forgiving nature of VB code

Create Projects in Visual Studio

  • Optimize the Visual Studio settings
  • Create a console project in Visual Studio
  • Projects and solutions
  • Examine the template structure and code
  • How the editor enhances our code
  • Use the auto suggestions when editing
  • Compile the project code
  • Run the example code from Visual Studio
  • Run the example code with a debugger

Work with Multiple Projects

  • What applications can you create
  • Add additional projects to the solution
  • Understand code containers - Modules and classes
  • Choose a startup project
  • Review the desktop template code
  • Review the web application template code

Program Flow

  • Understand default code flow for an application
  • Event driven code
  • Create a program loop to run an application indefinitely
  • Listen for KeyChar to terminate the loop
  • The To-Do application
  • Work with a Windows UI project
  • Add click event handler code
  • Add TextChanged event handler code

Variables and Constants

  • Work with variables and constants
  • Use the code explorer project
  • Declare a variable
  • Variables and .NET types
  • Naming your variables
  • Understand the variable scope - What code can access the variable
  • How data conversion works
  • Convert numeric values
  • Create custom constants
  • Work with built-in constants
  • Work with enum values
  • Create a custom enum

Work with Strings

  • Understanding strings
  • Create string variables
  • Concatenation and interpolation
  • Search string contents
  • Modify string contents
  • String creation with StringBuilder
  • Compare and equals
  • Convert and format numbers to strings
  • Implicit covert strings to numbers
  • Use Parse and TryParse conversions

Date and Time

  • The date types
  • Define date and time variables
  • Initialize date and time values
  • Output formatted date values
  • Date manipulation
  • Challenge - Strings, dates, and parsing
  • Solution - Strings, dates, and parsing

Refactor Your Code Into Functions and Subs

  • Understand procedures and methods
  • Add procedures to a module
  • Call procedures from the application
  • Add procedures to a class
  • Add code to functions
  • Use parameters with procedures

Debugging Your Code

  • Some essential debug tools
  • Add breakpoints to code
  • Step through the code while debugging
  • Use the watch windows to see runtime data

Operators

  • Explore the arithmetic operators
  • Explore the comparison and logical operators

Control Flow - Branch Statements

  • The Code Explorer updated UI
  • If and else statements
  • Use the AndAlso and OrElse logical operators
  • Select case - A better way to branch
  • Challenge - Logic statements and string compare
  • Solution - Logic statements and string compare

Control Flow - Loop Statements

  • Use For loops to run code a specific number of times
  • Use Do loops to run code until a condition is fulfilled
  • Exit or continue loops
  • Challenge - Pentagonal rings
  • Solution - Pentagonal rings

Object-Oriented VB

  • Classes and OOP
  • Define a property
  • Create a constructor
  • Object inheritance
  • Interface inheritance

Work with Lists and Arrays

  • Explore the collection classes
  • Use a ListBox instead of a text control
  • Create new collections
  • Initialize a collection
  • Add items to a list
  • Get items from the list
  • Remove items from a list
  • Iterate over a list
  • Bind a list to a user control
  • Delegates and lambda expressions
  • Customize a method with predicate functions
  • Quick look at other collection classes

Query Lists with LINQ

  • LINQ - Enumerable and extension methods
  • Work with extension methods
  • Use LINQ with lists
  • Use lambda expressions with LINQ

Error Handling

  • What happens when the unexpected happens
  • The default response to unhandled exceptions
  • The Windows event log
  • Use try catch for exception handling

Conclusion

  • Next steps
120,000 Toman