preventing Keystrokes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. I am trying to prevent users from using the "Delete" and
"Backspace" keys on the keyboard in my application. Any help would be
greatly appreciated.

Thank You,

Brenton Walker Garman
 
Hello Brenton,

You can use code below for the specific controls in you app, but if you need
to handle for the whole app, use global hooks. Google for samples

if (e.KeyCode == Keys.Back || e.KeyCode == Keys.Delete)
{
MessageBox.Show("Key is pressed");
}

BG> Hello. I am trying to prevent users from using the "Delete" and
BG> "Backspace" keys on the keyboard in my application. Any help would
BG> be greatly appreciated.
BG>
BG> Thank You,
BG>
BG> Brenton Walker Garman
BG>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Back
Top