Quick Visual Studio 2010 tip: Pin to Source command and monitoring watches
Posted: (EET/GMT+2)
This blog post is about an older but still highly useful Visual Studio feature: pinning a watch value's tooltip to the screen so that is always visible. This feature was introduced in Visual Studio 2010, so it's something that is already about two years old, but since I do get questions about this command from time to time, I thought it proper to share.
Firstly, the command name is officially Pin to Source. This command can be found in the code editor when right-clicking a variable name while debugging your application (and the application is stopped on a breakpoint, for instance).
When you move your mouse cursor over a variable, Visual Studio will display the variable's value in a DataTip. However, the problem with this feature is that as soon as you move your mouse out from the variable name, the tooltip disappears.
This is where the Pin to Source command comes to the rescue. Right-click the variable in your code editor, choose the command, and there you have it: a sticky DataTip that stays on the screen even if you move your mouse. What's more, the tip of updated whenever the monitored value changes, and you can even write quick comments next to the tip to records small amounts of information.
Hope this feature helps you in your debugging sessions!