my application is Windows Forms (VS2010 C#); I set a double variable at the beginning of the form as:
private double Wwidth;
Then I change the its value when I open a file:
Wwidth = image.WindowWidth;
The value of Wwdith equals 265.0. When I select a trackbar,
private void tbrWidth_Scroll(object sender, System.EventArgs e)
{
double newWidth = tbrWidth.Value;
double wd = Wwidth - newWidth;
...}
the value of Wwdith changes to 0.0?
Any suggestions. Thanks in advance.
Variables don’t change themselves. So there are two possibilities:
To rule out 2, you could put (in the two places):
If you get the same number printed from both places, you’re probably still in the same instance. To rule out 1 – change it and put a break-point in:
Now you should stop automatically at any code that is changing the value