次の方法で共有


The Watch Window: Moving Values Between Watch Windows

Keyboard:  CTRL + ALT + W,1; CTRL + ALT + W,2; CTRL + ALT + W,3; CTRL + ALT + W,4
Menu:  Debug -> Windows -> Watch -> Watch [1,2,3,4]
Command:  Debug.Watch[1,2,3,4]
Versions:  2008,2010
Published:  10/9/2010
Code:  vstipTool0105

 

 

You can have up to four Watch windows in Visual Studio.  The reason you get all these windows is so you can easily organize your watches into groups.  Getting to them is easy enough, just press CTRL + ALT + W and then the number of the window you want 1,2,3, or 4:

image

 

 

The only problem is that anytime you use Add Watch or QuickWatch the watch always gets added to Watch 1:

image

 

 

 

Moving Between Windows

What if you want to move to another window?  Let's look at some of your options.

 

Just Type It In

You can always just go to the window you want and type in the value you are looking for:

image

 

 

Copy and Paste

You can always copy and paste the value from one window to another:

image

 

NOTE:  You can copy but not cut in the Watch window.  You will have to delete the original value from Watch 1 if you want to actually "move" it.

 

 

Click and Drag

You can always CLICK AND DRAG to copy a value from one window to another as well.  Just find your value and then CLICK AND DRAG the value to the new window:

image

image

 

And release to copy the value:

image

 

 

There you go.  Now you have several ways to move watches from one window to another.