I have a form
I have the variable 'a' declared at the class level.
public partial class Form1 : Form
{
int a;
public Form1()
{
InitializeComponent();
}
..........
}
I have button click events, one button increments 'a', the other decrements 'a'
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'.
I click 'continue' and i'd like to see the value of 'a' when I click the buttons.
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.
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.
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.
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.