I have three seperate timers that call a method in each of their _Tick. This method works fine, as intended, but within it is an if statement which checks to see if two values are either < or > than a number:
if ((x < y) || (x > z))
{
}
and within this statement, I want to stop those three times, show a message box and dispose the form. This is the code I'm using:
if ((x < yArray[0]) || (x > yArray[1]))
{
frmFooBar barFoo = new frmFooBar();
barFoo.tmrOne.Stop();
barFoo.tmrTwo.Stop();
barFoo.tmrThree.Stop();
MessageBox.Show(GlobalVariables.aVariable+ " is dead.");
barFoo.Dispose();
}
The conditional works fine, as when either statement is true, I'll get a MessageBox popup every tick. The problem I'm having is that none of those form functions are working. tmrOne,Two keep running, and the form does not close.
I'm still new to C# so maybe my problem is obvious, but any help would be great! Thank you.