It gives me such an error and I can't seem to work out what the problem is.
private void Form1.KeyDown(object sender, KeyEventArgs e) // **THE ERROR HERE**
{
if (ListBox1.Items.Contains(e.KeyCode))
{
ListBox1.Items.Remove(e.KeyCode);
ListBox1.Refresh();
if (timer1.Interval > 400)
{
timer1.Interval -= 10;
}
if (timer1.Interval > 250)
{
timer1.Interval -= 7;
}
if (timer1.Interval > 100)
{
timer1.Interval -= 2;
}
difficultyProgressBar.Value = 800 - timer1.Interval;
stats.Update(true);
}
else
{
stats.Update(false);
}
correctLabel.Text = "Correct: " + stats.correct;
missedLabel.Text = "Missed: " + stats.missed;
totalLabel.Text = "Total: " + stats.total;
accuracyLabel.Text = "Accuracy: " + stats.accuracy + "%";
}
It's code from some tutorial, so it should be working. What could possibly be the problem?