How to align or format codes in Visual Studio?

This is very simple in Visual Studio. Follow the below steps.

  1. Select the code you want to re-format.
  2. Press Ctrl-K
  3. Press Ctrl-F

The key combination Ctrl-K + Ctrl-F only works on selected text, so make sure you select the code you want to re-format before using it. You can easily reformat the entire code by pressing Ctrl-A  Ctrl-K  Ctrl-F.


One Response to “How to align or format codes in Visual Studio?”

Leave a Reply