C# 如何在 Visual Studio 中更改大括号/圆括号颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/418452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 02:38:31  来源:igfitidea点击:

How to change the braces/parenthesis colors in Visual Studio

c#visual-studioide

提问by Joan Venge

I am not talking about the highlight colors but the actual colors. I got a color scheme with light background color but the braces/parentheses are barely visible. Anyone knows how to change this?

我不是在谈论高光颜色,而是在谈论实际颜色。我得到了一个浅色背景的配色方案,但大括号/括号几乎不可见。有谁知道如何改变这个?

Btw this is for C# because C++ seems to color braces/parentheses using operator color.

顺便说一句,这是针对 C# 的,因为 C++ 似乎使用运算符颜色为大括号/圆括号着色。

采纳答案by Andrew Hare

Tools > Options > Fonts and Colors > "Display Items" : Plain Text

工具 > 选项 > 字体和颜色 > “显示项目”:纯文本

Unfortunately this changes a lot more than just braces but its the only way to target them as far as I know.

不幸的是,这不仅仅是大括号的变化,但据我所知,这是针对它们的唯一方法。

回答by Orion Edwards

As far as I have been able to find, you can't :-(

据我所知,你不能:-(

回答by jcollum

Bah, posted an answer and it got lost. FF and my proxy server aren't getting along.

呸,发布了一个答案,它迷路了。FF 和我的代理服务器相处不融洽。

I think there's no way to just change the color of the parens, they seems to follow the text color. I did find this toolthat lets you do all sorts of things with paren color; looked pretty nifty for $49.

我认为没有办法只改变括号的颜色,它们似乎遵循文本颜色。我确实找到了这个工具,可以让你用母色做各种事情;49 美元看起来很漂亮。

回答by John Hunter

I know this is an old already answered question but I found a solution that suited me at least.

我知道这是一个已经回答的旧问题,但我找到了一个至少适合我的解决方案。

Set the "Plain Text" colour to be the colour you want the braces to be then set the "Identifier" colour to be what you want the rest of the text to look like.

将“纯文本”颜色设置为您希望大括号的颜色,然后将“标识符”颜色设置为您希望其余文本的外观。

回答by Beau Harder

The Visual Studio 2014 CTP 14.0.22129 dark theme blacked-out the brackets and semi-colon for some reason. I was able to fix this by changing the foreground color of the "Punctuation" display item.

由于某种原因,Visual Studio 2014 CTP 14.0.22129 深色主题将括号和分号涂黑。我能够通过更改“标点符号”显示项目的前景色来解决这个问题。

回答by cary yuan

Tools > Options > Fonts and Colors >DisplayItem(D:):Parenthesis matching (square brackets) but visual studio 2015 Preview can only changge javascript braces/parenthesis color , C# 貌似不行:(

工具>选项>字体和颜色>DisplayItem(D:):括号匹配(方括号)但visual studio 2015 Preview只能更改javascript括号/括号颜色,C#貌似不能:(

回答by Kashif

To change item foreground and background colors in Visual Studio 2010 Ultimate fallow this: Tools->Options->Environment->General->Fonts and Colors. This worked for me to change Brace Matching(Rectangle) from default color which was barley visible, to my own chosen color.

要在 Visual Studio 2010 Ultimate 中更改项目的前景色和背景色,请执行以下操作:工具->选项->环境->常规->字体和颜色。这对我有用,将支撑匹配(矩形)从大麦可见的默认颜色更改为我自己选择的颜色。

回答by HamidReza

Tools > Options > Fonts and Colors > Display Items : Punctuation

工具 > 选项 > 字体和颜色 > 显示项目:标点符号

回答by Aashish

I have changed the color of Parenthesis, Curly Braces and semi-colon by selecting Tools > Options > Environment > Fonts and Colors > Display Items : Operator. Enjoy Coding :)

我通过选择工具 > 选项 > 环境 > 字体和颜色 > 显示项目:运算符更改了括号、花括号和分号的颜色。享受编码:)

回答by Youngjae

Visual Studio 2017 still has a problem to have black color as Default color in editor. Generally it's not, but it appeared to black by some reasons.

Visual Studio 2017 在编辑器中将黑色作为默认颜色仍然存在问题。通常不是,但由于某些原因它看起来是黑色的。

I changed below two items to Silverand press OK, and open Option again and back to Defaultit solved.

我将以下两项更改为Silver并按确定,然后再次打开选项并返回Default解决。

  • Tools > Options > Fonts and Colors > Display Items : Punctuation
  • Tools > Options > Fonts and Colors > Display Items : Operator
  • 工具 > 选项 > 字体和颜色 > 显示项目:标点符号
  • 工具 > 选项 > 字体和颜色 > 显示项目:运算符