简体   繁体   English

在 C# 中修复和 if 语句 Visual Studio 2019 编程之后的标识

[英]Fixing identation after and if statement Visual Studio 2019 programming in C#

After I type if (view=="") { and press Enter , VS formats and indents the curly braces to this:在我输入if (view=="") {并按Enter后,VS 格式化并缩进大括号:

 if (view == "")
            {

            }

How can I change the settings in Visual Studio 2019 to just have it like this如何将 Visual Studio 2019 中的设置更改为这样

  if (view == "")
  {

  }

I've been looking and trying different combinations and can't seem to find the setting.我一直在寻找并尝试不同的组合,但似乎找不到设置。

If you want to get the format you need, you can refer to the parameters of this option:如果你想得到你需要的格式,可以参考这个选项的参数:

Tools>Options>Text Editor>C#>Code Style>Formatting>Indentation, uncheck the option ”Indent open and close braces”.工具>选项>文本编辑器>C#>代码样式>格式>缩进,取消选中“缩进打开和关闭大括号”选项。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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