TIP: Where Does the Open Brace Go?


Want to start a fight between two coders? Ask them if the open brace goes on a new line or at the end of the method declaration! Luckily you can set up Visual Studio to put the brace in whichever location YOU prefer. Go to Quick Launch and type in "format" you will find lots of great options to control how your code is formatted by default in Visual Studio. Once you have the settings the way you want them, just use the keyboard shortcut CTRL+K+D to reformat any existing code.  See formatting in action in this short video.

More Tips? Check out Visual Studio Time Savers

Visual Studio guru, Susan Ibach, is a master of finding ways to save minutes. In her video series, Visual Studio Time Savers, she shares some of her favourite time saving tips. Give them a try and let her know what you think. There are more coming, so make sure to check back often or subscribe to the RSS feed to get her tips as soon as they are posted.

If one of these has helped you become more productive, make sure to comment on and share the videos.

Have a tip that has made you more productive? Let Susan know by tweeting to @cdndevs (hashtag #vstips) or commenting on the Microsoft Developer Facebook wall.

Comments (2)

  1. PaulTDessci says:

    What would be great is if one could manually format some sample code, select it, and command Visual Studio set its formatting options based on what it sees.

  2. peaceloveharmony@live.ca says:

    Ha! That's great, I didn't know about this one.

Skip to main content