简体   繁体   中英

Changing VS2010 text formatting

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

f(){
}

instead of

f()
{
}

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

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.

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

Uncheck all the "New lines option for braces"

在此输入图像描述

“工具”>“选项”>“文本编辑器”>“C#”>“格式设置”>“新行”>将“打开括号”放在控制块的新行上。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM