I want to stop a timer which is running in my Windows Form by pressing any key from the keyboard. Do you have any idea ?
For example, inside my Form, I am trying this :
myTimer.Tick += new EventHandler(TimerEventProcessor);
myTimer.Interval = 400;
if (Keyboard.IsKeyDown(Key.Enter))
{
if (myTimer.Enabled)
myTimer.Stop();
}
The problem is even I have already added the assembly PresentationCore.dll but Keyboard in the code above is not recognized. And I'am facing this error:
!!! "the name keyboard does not exist in the current context"