Can I customize the intellisense value shown when hovering while debugging in visual studio?

混江龙づ霸主 提交于 2019-12-21 04:31:22

问题


When I hover over a variable in visual studio, it brings up a small control which shows the variable name, type, and a + box for viewing members, etc. But for some types the variable type is replaced by more helpful information such as "{X = 0.0 Y = 0.0 Width = 0.0 Height = 0.0}" for a RectangleF.

Is there a way to specify what should be displayed? Is there an IDE setting? Is there a function attribute?

I am using visual studio 2008, language is visual basic.


回答1:


The DebuggerDisplay attribute would be what you are looking for:

[DebuggerDisplay("x={xvar} Y={yvar} Width = {widthvar} Height = {heightvar}")]

More info can be found here




回答2:


You're looking for DebuggerDisplayAttribute. I wrote more info about using it and the capabilities it has here.



来源:https://stackoverflow.com/questions/471241/can-i-customize-the-intellisense-value-shown-when-hovering-while-debugging-in-vi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!