如何在Visual Studio中更改实例化对象字体颜色

时间:2021-08-08 23:22:43

I know the colours are changed in Environment > Fonts and Colors but I haven't found out which Display Item the object is.

我知道环境>字体和颜色中的颜色已更改,但我还没有找到对象所在的显示项目。

Can someone please tell how I can colour the following code:

有人可以告诉我如何为以下代码着色:

lblMessage.Text = "You have successfully answered my question!"

lblMessage.Text =“你已经成功回答了我的问题!”

I have the string coloured pink, I would like the lblMessage purple and the .Text a light green.

我的字符串是粉红色的,我希望lblMessage紫色,而.Text是浅绿色。

For me the darker the colour the less it will "change". I won't often change object names, I'll more often change properties and am always changing strings - although I have another question about this that I'll post later.

对我来说,颜色越深,“变化”越少。我不会经常更改对象名称,我会更频繁地更改属性并且总是更改字符串 - 尽管我还有另外一个问题,我稍后会发布。

Thanks

2 个解决方案

#1


1  

Go to Environment > Fonts and Colors > Display Items and change

转到环境>字体和颜色>显示项目并进行更改

  • Identifier
  • String

I was hoping that their is I can be more specific with the colours - if their isn't then that's an acceptable answer - just disappointing for me.

我希望他们的颜色可以更具体 - 如果他们不是那么这是一个可以接受的答案 - 对我来说只是令人失望。

Yeah, I don't think you can do that. :)

是的,我不认为你能做到这一点。 :)

#2


1  

This is possible if you use a 3rd party addin like Visual Assist. It lets you assign different colors to classes, variables, macros and functions (among other features).

如果您使用Visual Assist等第三方插件,则可以使用此功能。它允许您为类,变量,宏和函数(以及其他功能)分配不同的颜色。

#1


1  

Go to Environment > Fonts and Colors > Display Items and change

转到环境>字体和颜色>显示项目并进行更改

  • Identifier
  • String

I was hoping that their is I can be more specific with the colours - if their isn't then that's an acceptable answer - just disappointing for me.

我希望他们的颜色可以更具体 - 如果他们不是那么这是一个可以接受的答案 - 对我来说只是令人失望。

Yeah, I don't think you can do that. :)

是的,我不认为你能做到这一点。 :)

#2


1  

This is possible if you use a 3rd party addin like Visual Assist. It lets you assign different colors to classes, variables, macros and functions (among other features).

如果您使用Visual Assist等第三方插件,则可以使用此功能。它允许您为类,变量,宏和函数(以及其他功能)分配不同的颜色。