它给了我这样的错误,我似乎无法弄清楚问题所在。
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 + "%";
}
这是一些教程的代码,所以它应该可以工作。可能是什么问题?