Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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

Community Additions

© 2015 Microsoft