private void txtPage_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(27)) { ToggleState(); } }