public MainForm() { InitializeComponent(); // KeyPressHandler = new KeyPressHandler(); this.KeyDown += OnKeyDown; Timer mainTimer = new Timer(); mainTimer.Interval = 30; mainTimer.Tick += mainTimer_Tick; mainTimer.Start(); }