Visual Studio-"{}"设定 [英] Visual Studio - "{ }" settings

查看:120
本文介绍了Visual Studio-"{}"设定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

严重的是,我不知道该用什么.事情就是这样,我喜欢这种类似于Java的代码编写:

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

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

但是VisualStudio用自己不喜欢的样式"帮助"了我,我无法更改(经过相当长时间的拼命检查所有设置:/)

But VisualStudio "helps" me with his 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 ...

我正在使用MS Visual Studio 2010专业版

I am using MS Visual Studio 2010 professional

任何帮助表示赞赏!

推荐答案

转到工具>选项>文字编辑器> [语言,即C#]>代码样式>格式>新行

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.

这篇关于Visual Studio-"{}"设定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆