title: How can I monitor a variable in the watch window throughout a winforms application?
body: <p>I have a form</p>
  
  <p><a href="https://i.stack.imgur.com/6fdbD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6fdbD.png" alt="enter image description here"></a></p>
  
  <p>I have the variable 'a' declared at the class level.</p>
  
  <pre><code>  public partial class Form1 : Form
      {
          int a;
          public Form1()
          {
              InitializeComponent();
          }
          ..........
      }
  </code></pre>
  
  <p>I have button click events, one button increments 'a', the other decrements 'a'</p>
  
  <p>I want to view 'a' in the watch window, this should idealy be possible as soon as a form loads as the program doesn't just terminate there, but anyhow, it seems I have to put a breakpoint somewhere in order to view 'a', so I put a breakpoint at the form load and hit 'play' and see 'a'.</p>
  
  <p>I click 'continue' and i'd like to see the value of 'a' when I click the buttons. </p>
  
  <p>But it seems to only do it on a breakpoint. Once I hit a button, then unless I added a breakpoint, it won't show me the value.</p>
  
  <p><a href="https://i.stack.imgur.com/l9N6s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l9N6s.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/4C295.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4C295.png" alt="enter image description here"></a></p>
  
  <p>I don't really want to have to set breakpoints just to see the value of a variable wherever it is in the program.  And I also don't want to have to jump into my code when i'm really trying to just navigate the GUI and see the value of variables as I do so.</p>
  
  <p>The best I can do at the moment, it seems, is put breakpoints at a curly brace of the first form load and the ending curly brace of the relevant events that could affect the value.  But it seems like it shouldn't be necessary to do that and it is a slight distraction if trying to click around a gui, to have it keep jumping into code.  In a more complex GUI I might want to click around a bit to see if I can create an inconsistent state with respect to my variables, being paused like that on every click seems unnecessary and a slight distraction.</p>
  
  <p>I'd like to monitor the variable throughout the program, rather than just at specific points. I am a little surprised if there isn't an option to do so, or perhaps there is but I can't see it.</p>