Visual Basic Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded A4 summary of Visual Basic 17.13 on .NET 10 (LTS), checked on 2026-10-19 and available as a downloadable PDF — the dotnet commands and .vbproj properties, the file skeleton, comments and line continuation, the elementary types with their sizes and literal suffixes, conversions, the operator precedence ladder with &, AndAlso, OrElse, Is Nothing and If(), control flow, procedures, parameters and lambdas, classes, structures, modules, interfaces, enumerations and events, access and inheritance modifiers, generics and constraints, arrays and collections, LINQ in query and method syntax, XML literals and axis properties, Try/Catch and the legacy On Error, the My namespace and the runtime library, compiler directives and attributes, Async/Await and threading, interop one-liners, the best practices and gotchas, and a strip that maps legacy VB6, VBA and VBScript constructs and old .NET APIs to their modern replacements — handy for quick memorization or as a printable desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Getting started — Getting Started, Visual Basic and .NET, History, Versions and Language Strategy, and Visual Basic for Programmers of Other Languages.
Core language — Program Structure and Code Conventions, Option Statements, Data Types and Literals, Type Conversions, Variables, Constants and Scope, Enumerations, Operators and Expressions, Control Flow, Nothing and Nullable Value Types, Strings and Text, Dates, Times and Formatting, and Numbers and Math.
Procedures and functional features — Procedures: Sub and Function, Delegates and Lambda Expressions, Extension Methods and Partial Methods, Iterators and Yield, and Generics.
Types and object-oriented programming — Classes and Objects, Properties and Default Properties, Modules and Shared Members, Structures and Value Types, Inheritance and Polymorphism, Interfaces, Events and Handlers, Operator Overloading and Equality, Tuples and Anonymous Types, and Object Lifetime and Disposal.
Arrays, collections, LINQ and XML — Arrays, Collections, LINQ Query Expressions, and XML Literals and Axis Properties.
Errors, async and concurrency — Structured Exception Handling, Unstructured Error Handling (On Error), Async and Await, and Threads, Parallelism and Synchronization.
Runtime library, My and I/O — The My Namespace, The Visual Basic Runtime Library, Files, Directories and Streams, and Serialization: JSON and XML.
Compilation, binding and reflection — Conditional Compilation and Directives, Attributes, Caller Information and Reflection, and Early and Late Binding.
Interoperability — Interop with C# and Other .NET Languages, Native Interop: Declare and P/Invoke, and COM Interop and Office Automation.
Applications — Console Applications, Windows Forms Applications, WPF Applications, Data Access: ADO.NET and EF Core, Web, HTTP and Services, and Libraries, Packaging and Deployment.
Tooling — Projects, MSBuild and the dotnet CLI, Debugging and Diagnostics, Testing, and XML Documentation, Analyzers and Code Style.
Practice, legacy and migration — Best Practices and Common Pitfalls, Security and Cryptography, Design Patterns in Visual Basic, The VB Family: VB6, VBA and VBScript, and Migrating Legacy Visual Basic.
References
-
Visual Basic documentation, What’s new in Visual Basic and Visual Basic language strategy
-
Visual Basic Language Reference and Visual Basic Language Specification
-
The complete, grouped bibliography is on the section landing page