Q:

Display an error message if an invalid number is entered

I have a menu screen in WinForms with options from 1-8.
You may find below the method KeyDown:
        private void Form2_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.D1)
        {
            Form3 f3 = new Form3();
            f3.ShowDialog();
        }

        else if (e.KeyCode == Keys.D2)
        {
            Form4 f4 = new Form4();
            f4.ShowDialog();
        }

        else if (e.KeyCode == Keys.D3)
        {
            Form5 f5 = new Form5();
            f5.ShowDialog();
        }

        (...)

        else if (e.KeyCode == Keys.D8)
        {
            this.Close();
        }
    }

What should I do to display an error message if an invalid number is entered?
Thanks.

A:

An else after all the else if to do MessageBox.Show() with the error message?

