Click here to Skip to main content
15,561,685 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How i can disable a key of keyboard?
Updated 12-Aug-12 1:11am
_Amy 12-Aug-12 5:46am    
Why you want to disable keyboard key? Which key you want to disable? What have you tried yet?
amirmohamad 12-Aug-12 5:49am    
disable the enter key

1 solution

Try this:
if (e.KeyCode == Keys.Enter) {
    e.SuppressKeyPress = true;

Share this answer
amirmohamad 12-Aug-12 5:58am    
write this In void onkeydown
_Amy 12-Aug-12 6:00am    
I don't suppose to do your homework here. I am here to help you only. Try it using google and do your homework.
amirmohamad 12-Aug-12 6:02am    
ok tank's for help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900