Visual Studio Code Formatting

Well written code will have proper formatting & indentation. This helps to read the code much easier.

Visual Studio has built in features which automatically format the code as we write. It also provides customization features using which we can tell Visual Studio to How our code should be formatted. To do this we can make use of Options dialog.

To invoke this dialog click on menu item Tools -> Options. From Options dialog select Text Editor -> C# -> Formatting

Visual Studio 2008 Options Dialog

Visual Studio Options Dialog

We can format document using menu item Edit -> Advanced -> Format Document. Keyboard shortcut Ctrl + E, D

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: