margarit
asked on
System.Windows.Forms.Timer GetBoardTypeConnected;
Hello,
I have problems with the following code.
I wanted to enter the "GetBoardTypeFunc" only once, therefore in this function I stop the timer.
Although I stopped the timer I see that I continue to enter the "GetBoardTypeFunc" function.
Why?
Should I unsubscribe from the event EventHandler(GetBoardTypeF unc)?
If yes, what is a sintax?
THANKS
Margarit
I have problems with the following code.
I wanted to enter the "GetBoardTypeFunc" only once, therefore in this function I stop the timer.
Although I stopped the timer I see that I continue to enter the "GetBoardTypeFunc" function.
Why?
Should I unsubscribe from the event EventHandler(GetBoardTypeF
If yes, what is a sintax?
THANKS
Margarit
System.Windows.Forms.Timer GetBoardTypeConnected;
//////////////////////////////////////////////////////////////////////////////////////////////////////
private void GetBoardType()
{
GetBoardTypeConnected = new System.Windows.Forms.Timer();
GetBoardTypeConnected.Interval = 400;// 250;
GetBoardTypeConnected.Start();
GetBoardTypeConnected.Tick += new EventHandler(GetBoardTypeFunc);
}
private void GetBoardTypeFunc(Object state, EventArgs eArgs)
{
a++;
GetBoardTypeConnected.Stop();
GetBoardTypeConnected.Dispose();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER