473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Difference of Keypress and KeyDown event

What's the difference between Keypress and KeyDown event?
looks like some key cannot be handled by both event.
Can anyone list out the details and their usage for best pratice?
May 19 '07 #1
1 18453
KeyPress is invoked only for character (printable) keys where as KeyDown is
raised for nonprintable such as Control, Shift, etc.

If you want to filter character input (such as allowing only numeric) then
KeyPress is a better choice.

"windy" wrote:
What's the difference between Keypress and KeyDown event?
looks like some key cannot be handled by both event.
Can anyone list out the details and their usage for best pratice?
May 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Suresh | last post by:
How do I insert a char into the textfield on the keypress event of another textfield? I have two textboxes, "text1" and "text2". Important: "text1" is outside the table. "text2" is inside...
3
by: Peter Verburgh | last post by:
Is there an easy way to capture the keypress - keydown events from a LABEL control ? Standard the control doesn't handle these events. The label control inherits from the control class , and this...
2
by: orekinbck | last post by:
Hi There In C# windows app, .NET 2003 I have a text box with the following event handler: private void textBox3_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode...
2
by: ZS | last post by:
Hi, On a form , I'm trying to trap when a shift key is pressed. Can someone explain how the KeyUp,KeyDown and Key Press event works for Forms. Thanks -ZS
2
by: Will Gillen | last post by:
I am building a hoem theatre app that is controlled by an IR Remote Control. The Remote has some keys that map to "keyboard" commands (i.e. PageUp, PageDown.). In this VB.NET application I have...
2
by: Phil Galey | last post by:
I have a Panel control docked on all sides on a form and the panel control contains a PictureBox. I'm using the KeyDown event of the form to respond to the and keys for resizing the image and the...
3
by: Luc The Perverse | last post by:
Hey - I am making my first C# form application! (More a teach myself app than any pratical application) I have a listbox that always has the control so I made an event handler for KeyDown. I...
3
by: win | last post by:
when the cursor is in a textbox, only coding in the keydown event of the textbox triggered, the coding in the keydown event of the form does not triggered! Problem: I need to change a VB6 program...
4
by: Tom P. | last post by:
You wouldn't think this would be as hard as it is but for some reason I can't find a way to translate any of the codes in the KeyDownEventArgs into the actual characters they represent. The best...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.