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条回答
神经病院院长
2楼-- · 2020-05-21 09:23

I came here from google while looking to do the same thing with Visual Studio 2017 community edition. The answers above point out you can turn this on for VB and C#. The option does not exist for C or C++. ie. for C/C++ the option does not exist in advanced settings so you can not right click the variable and select highlight variable.

However, I learned its simpler for C/C++ to get the equivalent behaviour. Simply double click the variable/function to select it. The editor will highlight all instances of the variable or function in the file. Its not limited by blocks. Its highlighted in the entire file.

查看更多
戒情不戒烟
3楼-- · 2020-05-21 09:25
对你真心纯属浪费
4楼-- · 2020-05-21 09:25

I think you mean placing a cursor over the line and then pressing F9. This will make the code stop there. Place the mouse cursor over the desired string value and it will pop up....that's the lazy way I do it..:-)

查看更多
Deceive 欺骗
5楼-- · 2020-05-21 09:32

in vs 2012: Tools > Options > Env > Fonts and Colors > Text Editor > Highlighted Reference

查看更多
登录 后发表回答