Win.CodeNavi.frmMain.txtCodePath_KeyPress C# (CSharp) Méthode

txtCodePath_KeyPress() private méthode

private txtCodePath_KeyPress ( object sender, KeyPressEventArgs e ) : void
sender object
e KeyPressEventArgs
Résultat void
        private void txtCodePath_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (Char)System.Windows.Forms.Keys.Escape)
            {
                if (MessageBox.Show("Are you sure you wish to exit?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Application.Exit();
                    e.Handled = true;
                }
            }
        }