From the course: Visual Studio 2019 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Format and arrange code layout

Format and arrange code layout - Visual Studio Tutorial

From the course: Visual Studio 2019 Essential Training

Start my 1-month free trial

Format and arrange code layout

- [Instructor] You can spend countless hours in Visual Studio working with code. Don't waste time manually moving code around the screen to get it arranged the way you want. Instead use the formatting tools available in Visual Studio to automate most of that process. Look at the code here. On line 14 through line 21, something doesn't look right. There's something odd about this code. Nothing's lined up. The int variable on line 14 and line 16 are offset. There's extra space on line 21. This doesn't fit my ideal vision of tidy code. I should rearrange this and make it look nicer. Of course I can manually do this. I could go up to line 14. And add an extra space after the word total like this but the point of this demo is to show you the automation tools. So, let's select that line. Click over here in the margin and then go to the Edit menu and look in Advanced. These first two items are the formatting tools. Format Document, Control + K, Control + D. It formats all the code in the…

Contents