Robert
Robert

Reputation: 233

Changing VS2010 text formatting

I am looking for a c# formatting which will do(like in Eclipse):

f(){
}

instead of

f()
{
}

I have checked tools->options formatting but could not find it.

Upvotes: 3

Views: 88

Answers (3)

Chris Sinclair
Chris Sinclair

Reputation: 23208

Tools -> Options 
    -> Text Editor 
        -> C# 
            -> Formatting 
                -> New Lines 
                    -> New line options for braces 
                        -> Place open brace on new line for ....

There are a few options in there, I'm guessing you're likely wanting to disable most of those. But specifically in this case I believe is for Place open brace on new line for control blocks.

In addition, check out the other options for C# in and around there. It's pretty extensive and most likely you'll be able to achieve whatever combination of style you desire.

Upvotes: 3

Gianni B.
Gianni B.

Reputation: 2731

Just follow this: Option -> Text Editor -> C# -> Formatting -> New Lines

Uncheck all the "New lines option for braces"

enter image description here

Upvotes: 3

Seth Flowers
Seth Flowers

Reputation: 9190

Tools > Options > Text Editor > C# > Formatting > New Lines > Place open brace on new line for control blocks.

Upvotes: 2

Related Questions