How to get Visual Studio 2010 to highlight instanc

2020-05-21 08:40发布

I'm new using vs2010 I've read that when you click on a variable its suppose to highlight all the instances of that variable in that file and highlight red or show an error as well where the number line is located. How can I get vs2010 to do this because by default it doesn't do that for me and it would be great for the highlighting to work. Thanks.

10条回答
Explosion°爆炸
2楼-- · 2020-05-21 09:07

Options -> Environment -> Fonts and Colors -> Highlighted Reference then change foreground and background colors of your choice.

查看更多
3楼-- · 2020-05-21 09:08

On the Tools menu, click Options.

In the Options dialog box, expand Text Editor , and then complete one of the following tasks:

  • For Visual Basic, expand Basic, click VB Specific, and then select or clear Enable highlighting of references and keywords.
  • For C#, expand C#, click Advanced, and then select or clear Highlight references to symbol under cursor.

From: msdn

查看更多
劫难
4楼-- · 2020-05-21 09:08

In visual Studio 2012, Tools -> Options -> Environment -> Fonts and Colors -> [Text Editor] [Display Itemns] -> Highlighted References -> Item background: Choose the color you want.

查看更多
淡お忘
5楼-- · 2020-05-21 09:08

In case someone else bumps into this, much like I did looking for the same thing, Visual Studio Express editions don't support extensions, which means no selection highlighting in C++. More importantly, if you get an error trying to install an extension, don't worry, or rather, worry for other reasons, it's normal.

nuGet in 2012 is the only exception I've bumped into, but personally I (and I know many like me) have to use 2010.

查看更多
不美不萌又怎样
6楼-- · 2020-05-21 09:09

Productivity Power Tools for 2010 in the Visual Studio Gallery can do this, it took me a bit to find out how I did it, but in the Tools->Options... menu, there is a "Productivity Power Tools' drop down.

The default for the 'Words matching the caret location color in the editor' is fully transparent, so it isn't used. A color choice dialog pops up and you can set the color. Just ensure you set an alpha value above 1 to enable it.

The color values I used below are [153, 138, 188, 219] It seems to work well in light themes.Productivity Power Tools->Enhanced Scroll Bar

查看更多
对你真心纯属浪费
7楼-- · 2020-05-21 09:15

If you are using VS2013 the following extension would solve this

https://visualstudiogallery.msdn.microsoft.com/df093e9f-3e74-41c5-aeec-6371436423c5

查看更多
登录 后发表回答