This documentation is archived and is not being maintained.

How to: Display Line Numbers in the Editor 

You can toggle line numbering on and off in your code. For more information on finding particular lines of code, see How to: Navigate Code and Text.


The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.


Line numbers are not added to your code; they are for reference only. For line numbers to print, you must select Include line numbers in the Print dialog box. For more information, see How to: Print Code in the Editor.

To display line numbers in code

  1. On the Tools menu, select Options.

  2. In the Text Editor folder, choose the General options in the All Languages subfolder to set this option globally.


    Choose the General options in the subfolder for the language in which you are programming.

  3. Under Display, select Line numbers.

See Also