Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Aligning text in visual studio 2010?

  • 21-10-2011 4:15pm
    #1
    Registered Users, Registered Users 2 Posts: 377 ✭✭


    It seems the text on different lines in visual studio is not aligned. Here's an example of what I mean - say I have some code in visual studio and I want to have all the equals signs aligned with each other like this -
    string name         = 
    string age          =
    string address      =
    string dateofbirth  =
    
    instead it looks kind of like this
    string name         = 
    string age           =
    string address      =
    string dateofbirth =
    
    This is exaggerated but what Im saying is the equals signs on different lines cant be placed in exactly the same spot. This really makes the code look messy when you have about 20 items like this and they are not aligned with each other.

    So is there a way to set the text formating so they can be aligned?


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Why can't you do it as in the first part of your post. I do that all the time with just tabs. Just make sure the cursor is right before the = sign before you tab it out.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    It's down to the font probably. Ensure that you're using a monospaced font like Courier.

    Tools > Options > Environment > Fonts and Colors.


  • Registered Users, Registered Users 2 Posts: 377 ✭✭irishdude11


    Yeah it was the font, cheers.


  • Registered Users, Registered Users 2 Posts: 180 ✭✭Ste_D


    Can I recommend using Consolas?? I think it was made for developers!

    Also, in the VS IDE, if you click Edit -> Advanced, there is a 'View white space' options, so you can see what is spaces and what is tabs. I usually turn this on, but also go to the fonts and colors manager and tone it down a bit!!


  • Registered Users, Registered Users 2 Posts: 15,065 ✭✭✭✭Malice


    Ste_D wrote: »
    Can I recommend using Consolas?? I think it was made for developers!
    If we're suggesting IDE fonts I would highly recommend Anonymous Pro.


  • Advertisement
Advertisement