Visual Studio Tip #2: Pin your data tips

[cross posted from my MSDN blog]

Most people know that when you are debugging, you can hover the mouse over a variable in your code and the tool tip will provide you the current value.

For example, if I hover over the “uri” variable below it shows me that it’s current content is “http://azure.microsoft.com/”

PinDataTips

That is very helpful, but what if I am going in and out of this code very often. Say I’m calling the function multiple times and I want to see this value each time. I want to quickly glance at the value instead of having to hover and wait.

I could use the Watch Window and add the uri variable to that. Then it would always show me the value but its not as convenient as it could be.

Look at the right end of the data tip. That is a pin! Click that.

pinyourtips2

Now the value is pinned in place right where I can see it – no hunting for it. It is pinned to line 30 and will stay there while I’m in debug mode (even if I stop and restart debugging). It will update in real time and, because it is right in the code, I have the context to know exactly what it is for.

In addition, if I hover over the pinned data tip, I can add a comment to help me remember why I pinned it there.

pinyourtips3

For more on Data Tips, see the documentation

This post is part of a series of Visual Studio tips. The first post in the series contains the whole list.

About Negative Eddy

Professional Geek - I work for Microsoft
This entry was posted in VSTips. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s