Share via


Tutorial: Learn to use the code editor with Visual Basic

In this tutorial, you'll try out the code editor in Visual Studio. You'll add code to a file to learn some of the ways that Visual Studio makes writing, navigating, and understanding Visual Basic code easier.

This article assumes you're already familiar with Visual Basic. If you aren't, you might want to start with a tutorial like Create a simple Visual Basic (VB) console app.

To complete this tutorial, make sure you have the Visual Basic settings selected for Visual Studio. For information about selecting settings for the integrated development environment (IDE), see Select environment settings.

If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.

Create a code file

Start by creating a file and adding some code to it.

Use code snippets

Visual Studio provides code snippets that you can use to quickly and easily generate commonly used code blocks. Code snippets are available for various programming languages, including Visual Basic, C#, and C++. You'll now add the Visual Basic Sub snippet to the file.

Comment out code

In this section, you'll comment out some code.

Collapse code blocks

View symbol definitions

Use IntelliSense to complete words

Refactor a name

Next step