So. I've started learning basic programming, using special site which gives you video courses.

I've got my Visual Studio 2013 (Update 3), from special site for children of our school.
Now, everything went fine, until I had to meet "if" statements in C#.
Curly brackets are finished just fine, and you may think I'm histerical but, man, I really hate the way it does it, for example, it does:

if (ourValue == 50)
{
    Console.WriteLine("ourValue is indeed equal to 50");
}   

But I'm fan of always doing:

if (ourValue == 50) {
    Console.WriteLine("ourValue is indeed equal to 50");
}   

And I know it's stupid for yanking like a 'lil kid "I don't like this way cry", but I feel cold chill through my spine whenever I see Visual Studio correcting me that way, I just can't stand that I can't automatically write the code, in my style and I have to force myself to write code in other format than I'm used to.

Is there a way to change it? Not turn it off, change it.

Dani AI

Generated

Nice follow-up, . After you flip the new-line brace options, remember that existing files will keep their old layout until you reformat them. Use Edit -> Advanced -> Format Document (shortcut: Ctrl+K, D) to apply your preference across the file, or select a region and use Ctrl+K, F. This is the quickest way to clean up any templates or snippets that were created with a different brace style.

If the editor still pushes braces onto a new line, two common culprits are:

  • A solution-level .editorconfig that overrides your local setting.
  • An extension (e.g., code style/cleanup tools) applying its own formatting profile on save or on paste.
    In those cases, update the shared settings or the extension profile so everything agrees.

For future readers on newer Visual Studio versions, you can lock this in for the whole repo with an .editorconfig. Drop a file at the solution root like:

[*.cs]
csharp_new_line_before_open_brace = none
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true

That enforces K&R-style braces project-wide and helps teammates stay consistent. Developers on older VS versions who do not honor .editorconfig will still rely on the standard Options you already found, but committing the file ensures modern IDEs and CI analyzers keep the style in sync.

One last tip: if you export your IDE settings (Tools -> Import and Export Settings), you can reapply them instantly on other machines so you are never fighting the formatter again.

Under "Tools->Options->Text Editor->C#->Formatting->New Lines" are the rules for the open brace on each case (new methods, control blocks, etc), maybe you can find the one you want there.

I'm not proud of doing the easy whacky way of just asking for help without trying to find it on internet. But right after I posted, I went on my research. From quote above you come into a menu, where you have about 7 possible ways to disable/enable "new-line-brackets", if you love 'em the same way I do love 'em, just uncheck all the boxes and it won't bother you anymore [Frozen fans disappointed?]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.