Display Line Numbers in Visual Studio 2010 Editor

In this article we have a look at how to enable line numbers in Visual Studio 2010 Source Editor Window. You often see Visual Studio code with or without line numbers. When you try to add line numbers with Visual Studio 2010 Source Editor, you might receive an error massage. This behavior is by default and happens when we try to add line numbers manually.  

Let us see how to enable or disable the display of line numbers in the Visual Studio 2010 Source Editor Window. To turn on line numbers the following explains a simple procedure to do that.

Step 1: On the Tools menu, click "Options".


Step 2: When we click on the option, the Options window will be displayed:


Step 3: In the Options pop-up box select "Text Editor" and expand it and select "All languages" and expand it and select "General".


"Text Editor" -> "All languages" -> "General"


Step 4: In the General page's right side panel you need to select the check box "Line numbers" under the "Display" section as shown in the following image.


Step 5: Now click "OK" to save the changes and test it.


Step 6: Uncheck the check box of the line number and click the "Ok" button that prevents line numbers.