Search code examples
vb.netvisual-studio-2012code-organization

Aligning text under Visual Studio code


How to align/indent text under Visual Studio 2012, to achieve the below:

Original code

SomeThing = A + B + C
SomeLongerThing = D + E + F

Organized code

SomeThing          = A + B + C
SomeLongerThing    = D + E + F

If I try to hit Tab button on keyboard to add indentation, Visual Studio automatically squeezes the code back to the orignial position (as shown in the Original code above).


Solution

  • This is part of the pretty listing feature of VS. See Tools -> Options ... -> Text Editor -> Basic -> VB Specific -> Checkbox "Pretty listing (reformatting) of code".

    Related: Turn off pretty listing in visual studio