And now for something a little different…

Ever been debugging some code and wanted to quickly change a variable’s value without having to stop debugging?  Here’s what to do…

  1. Add the value to the watch window (You can select the variable and drag it into the watch window as shown below). 
  2. Then, double-click the variable’s contents within the watch window, and you’ll be able to edit.  Either click outside this field or press enter to commit the change, and the variable will contain the new contents.

Dragging Variables into Watch Window

Commit changes to Watch Window by hitting enter

Contents have changed at run-time

If you need to clear the watch window’s variable contents, just hit delete on that row.

Technorati Tags: VS2005Tip,VS2008Tip