Visual-studio – Visual Studio – “{ }” settings

code formattingvisual studio

Seriously, I don't know what to google. Here's the thing, I like this Java-like code writing:

if (condition == true) {
   doSomeStuff();
}

But VisualStudio "helps" me with its own "style", which I don't like and I am unable to change (after rather big time of desperate checking all settings :/)

if (condition == true)
{
  DoStuff();
}

I obviously want the "{" char to be in same line where condition is …

I am using MS Visual Studio 2010 professional.

Best Answer

Go to Tools > Options > Text Editor > [Language, i.e.: C#] > Code Style > Formatting > New Lines

This is where you can set your new line options for braces.

See the image below for more clarification.

menu