Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes how to show or hide line numbers in your code.
Note
If you enable line numbering, the line numbers you see aren't added to your code. The numbers are displayed in the view for reference only.
Open the Tools > Options pane, and expand the All Settings > Languages section.
Expand the language section you're using (such as C# or Visual Basic), and then expand the General section.
Select the Line numbers checkbox to show line numbers, or clear the checkbox to hide line numbers.
You can also configure line numbering for all supported programming languages. There are several methods to access the default global setting:
In the Tools > Options pane, expand the All Settings > Languages > Defaults > General section. The Line numbers setting on this page is the global option for all supported languages.
Use the Visual Studio Search box. Select Ctrl+Q to open the Search box, and enter line numbers. In the results list, double-click the Line numbers (languages.defaults.general.lineNumbers) entry.
The Options pane opens to the section that contains the global Line numbers option.
In the Options pane, enter line numbers in the Search box above the navigation tree. The tree refreshes to show the section that contains the global option. Select the section to go to the Options page that contains the global Line numbers option.
On the Visual Studio menu bar, select Tools > Options.
In the Options dialog, expand the Text Editor section.
Expand the language section you're using (such as C# or Visual Basic), and then expand the General section.
Select the Line numbers checkbox to show line numbers, or clear the checkbox to hide line numbers.
Select OK.
You can also configure line numbering for all supported programming languages. There are several methods to access the default global setting:
In the Tools > Options dialog, expand the Text Editor > All Languages > General section. The Line numbers setting on this page is the global option for all supported languages.
Use the Visual Studio Search box. Select Ctrl+Q to open the Search box, and enter line numbers. In the results list, double-click the Turn line numbers on or off entry.
The Options pane opens to the section that contains the global Line numbers option.
- In the Options dialog, enter line numbers in the Search box above the navigation tree. The tree refreshes to show the section that contains the global option. Select the section to go to the Options page that contains the global Line numbers option.