locked
How do I add the line numbers on the left side of the code view? RRS feed

  • Question

  • I know it is probally right in front of my face, I just cannot seem to find the option in order to have Visual C# number my lines in code view. If anyone could offer some help on this i'd greatly appreciate it, Thanks!
    Friday, May 8, 2009 7:36 PM

Answers



  • Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    • Marked as answer by Sare311 Friday, May 8, 2009 8:09 PM
    Friday, May 8, 2009 7:56 PM
  • Click "Show All Settings" checkbox
    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
    • Marked as answer by Sare311 Friday, May 8, 2009 8:08 PM
    Friday, May 8, 2009 8:06 PM

All replies

  • Tools --> Options --> Text Editor --> C#, Check the Line Number box in the 'Display' groupbox
    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
    • Proposed as answer by JohnGrove Friday, May 8, 2009 8:04 PM
    Friday, May 8, 2009 7:42 PM
  • Tools > Options menu items. From the resulting dialog titled Options, expand the Text Editor Folder in the left hand frame, , then select General. In the resulting view on the right, check the Line Numbers check box in the Display section.


    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    • Proposed as answer by JohnGrove Friday, May 8, 2009 8:04 PM
    Friday, May 8, 2009 7:44 PM
    • Got to Tools -> Options -> Text Editor -> All Languages -> General
    • Check Line numbers


    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    Friday, May 8, 2009 7:44 PM
  • I appreciate the quick response but that seems to be my probelm. I do not have that option, this is what I have under options / text editor/c# in the display box.

    Selection margin - Checked
    Indicator Margin - Checked
    Vertical Scroll bar - Checked
    Horizontal Scroll Bar - Checked

    Thats all it has in that area, I am using visual c# express edition if that makes any difference. Thanks again for the help.
    Friday, May 8, 2009 7:46 PM
    • Got to Tools -> Options -> Text Editor -> All Languages -> General
    • Check Line numbers


    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    Have u tried this?


    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    Friday, May 8, 2009 7:48 PM
  • Yes I just tried that, I tried that and the method John posted. Neither of them seem to have any line number options. I checked the help articles within Visual C# and it points me to the same exact spot you are pointing me to but there isnt any option there for line numbering. Every option that it shows for me is already checked. Thanks again for your patiance and help.
    Friday, May 8, 2009 7:53 PM


  • Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    • Marked as answer by Sare311 Friday, May 8, 2009 8:09 PM
    Friday, May 8, 2009 7:56 PM
  • A.m.a.L
    How did you load a pic? On your server or does Microsoft have one?


    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
    Friday, May 8, 2009 7:58 PM
  • A.m.a.L
    How did you load a pic? On your server or does Microsoft have one?


    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com

    i just use the img src from this location http://www.onedotnetway.com/tip-1-how-do-i-display-line-numbers-in-visual-studio/

    :)


    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    Friday, May 8, 2009 8:00 PM
  • Thanks!
    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
    Friday, May 8, 2009 8:02 PM
  • This is what I am seeing on mine. I dont get why it's so different..

    [IMG]http://i617.photobucket.com/albums/tt252/Sare311/VisualCScreenshot.jpg[/IMG]


    lol well it didnt work for me but just copy the link inside the Img tags into your browser and take a look. It quite honestly looks nothing like yours .
    • Edited by Sare311 Friday, May 8, 2009 8:06 PM
    Friday, May 8, 2009 8:05 PM
  • Click "Show All Settings" checkbox
    John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
    • Marked as answer by Sare311 Friday, May 8, 2009 8:08 PM
    Friday, May 8, 2009 8:06 PM
  • Thank you! Lord have mercy I cant believe I didn't notice that.. Thank you so much that sure enough did it.
    Friday, May 8, 2009 8:08 PM
  • Line Numbers in Visual C# 2008 Express

    I’ve been using Visual C# 2008 Express on my laptop (the full thing is outside of my budget at the moment), but it meets my needs quite well. However, while trying to diagnose a problem with one of my tests in NUnit (which I think is fabulous) I went back to Visual C# Express with line number in hand ready to find the problem. Of course, the line numbers aren’t shown by default in Visual Studio.

    Fortunately I had dealt with the problem before (in the full version of Visual Studio) and knew that it was a “per language” setting, which I always thought was kind of odd, but maybe most people don’t like seeing the line numbers for all their files (why?). Anyway, I went looking, but I couldn’t find it. Frustrated I jumped on my favourite search engine and quickly found the solution to my problem. Under the list of option categories there is a little checkbox labelled “Show all settings”.

    Checking this box gave me a bundle of extra options, including the ability to display line numbers (Text Editor » C#, then the “Line numbers” checkbox under Display). But I must ask, why is this some sort of advanced hidden option??

    So in future if I’m expecting an option to be show I will look for the magic “Show all settings” checkbox!

     

    Thanks i-Think-TwentyTwo for sharing the solution.

     

     



    Thanks,
    A.m.a.L

    .Net Goodies
    [Remember to click "mark as answered" when you get a correct reply to your question]
    Friday, May 8, 2009 8:09 PM