Placing Braces on New Line or on Method/ Function Line

Perhaps this will be of help. In the video, when defining a new Function/ Method, the first brace is shown to be in line with the method statement. In my case, the open braces always started on a new line. If anyone wants to have the opening brace start on the method statement line I found the following worked. It’s deep digging, but here is the sequence:

In Visual Studio click on Tools - Options - Text Editor - C# - Code Style - Formatting - New Lines and uncheck “Place open Brace on Newline for Methods and Local Functions”.

Hope this helps.

8 Likes

Thank you for that information :+1:

1 Like

What an awesome tip! There is even a preview window. Great find!

1 Like

I’m not gunna change it because to me it feels neater on a new line but i was wondering why it did that so thanks for sharing

Privacy & Terms