Changing Variables Display Format in Watch Window

By | January 17, 2011

While debugging in Visual Studio Watch window allows you to view the variables values in Hex Mode. This is very simple features, Just Right Click on Watch window and select Hexadecimal Display.


Once you select “Hexadecimal Display”, you will get the screen similar like below


But, You have noticed that all values has changed to hexadecimal format, but what If, If you want to do it for particular values, not for all. Let’s say, you want to get hex value for variable “b”. Here is the trick, you can use some comma (,) separated format “d” for Integer and “h” hex with in watch window to get the list of values.


From above image you can see, when we have “Hexadecimal display” on, we can still see integer value using “d” with the variable name. Similarly we can get the hex value of any variables with out change the display mode of watch window


Author: Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 thoughts on “Changing Variables Display Format in Watch Window

  1. Pingback: Dew Drop – January 18, 2011 | Alvin Ashcraft's Morning Dew

  2. Pingback: Interesting .NET Links - January 18 , 2011 | Tech Blog

Comments are closed.