473,767 Members | 4,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can anyone tell me when KeyPress event is raised

I noticed that I don't get KeyDown nor KetPress events if NumLock is not on.

I can probably find a workaround but it would be nice to know what the rules
are.

Can anyone tell me when KeyPress event is raised and when it isn't.

Thanks
Nov 21 '05 #1
3 1873
Key events occur in the following order:

1. KeyDown
2. KeyPress
3. KeyUp

The KeyPress event is not raised by noncharacter keys; however, the
noncharacter keys do raise the KeyDown and KeyUp events.

Do you have a more specific question than the order?

Chris

" Just Me" <gr****@a-znet.com> wrote in message
news:e5******** ******@TK2MSFTN GP15.phx.gbl...
I noticed that I don't get KeyDown nor KetPress events if NumLock is not
on.

I can probably find a workaround but it would be nice to know what the
rules are.

Can anyone tell me when KeyPress event is raised and when it isn't.

Thanks

Nov 21 '05 #2
Are you sure the keypad keys with NumLock off cause a KeyDown event?

I have a

Debug.WriteLine ("KEYDOWN " & e.KeyValue.ToSt ring)

at the top of the sub that handles and I see the effect of pressing the
keypad keys if NumLock is on but if I press NumLock to turn it off the
prints stop until I press it again to turn it on

Think I'm missing something?

Thanks a lot

"Chris, Master of All Things Insignificant" <chris@No_Spam_ Please.com> wrote
in message news:Oi******** ******@TK2MSFTN GP12.phx.gbl...
Key events occur in the following order:

1. KeyDown
2. KeyPress
3. KeyUp

The KeyPress event is not raised by noncharacter keys; however, the
noncharacter keys do raise the KeyDown and KeyUp events.

Do you have a more specific question than the order?

Chris

" Just Me" <gr****@a-znet.com> wrote in message
news:e5******** ******@TK2MSFTN GP15.phx.gbl...
I noticed that I don't get KeyDown nor KetPress events if NumLock is not
on.

I can probably find a workaround but it would be nice to know what the
rules are.

Can anyone tell me when KeyPress event is raised and when it isn't.

Thanks


Nov 21 '05 #3
It not the entire keypad that does not cause a KeyDown event - only the
arrow keys 4, 8, 6 and 2
Which are, naturally, the ones I'm interested in.
" Just Me" <gr****@a-znet.com> wrote in message
news:OW******** ******@tk2msftn gp13.phx.gbl...
Are you sure the keypad keys with NumLock off cause a KeyDown event?

I have a

Debug.WriteLine ("KEYDOWN " & e.KeyValue.ToSt ring)

at the top of the sub that handles and I see the effect of pressing the
keypad keys if NumLock is on but if I press NumLock to turn it off the
prints stop until I press it again to turn it on

Think I'm missing something?

Thanks a lot

"Chris, Master of All Things Insignificant" <chris@No_Spam_ Please.com>
wrote in message news:Oi******** ******@TK2MSFTN GP12.phx.gbl...
Key events occur in the following order:

1. KeyDown
2. KeyPress
3. KeyUp

The KeyPress event is not raised by noncharacter keys; however, the
noncharacter keys do raise the KeyDown and KeyUp events.

Do you have a more specific question than the order?

Chris

" Just Me" <gr****@a-znet.com> wrote in message
news:e5******** ******@TK2MSFTN GP15.phx.gbl...
I noticed that I don't get KeyDown nor KetPress events if NumLock is not
on.

I can probably find a workaround but it would be nice to know what the
rules are.

Can anyone tell me when KeyPress event is raised and when it isn't.

Thanks



Nov 21 '05 #4

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

Similar topics

1
1322
by: Top Gun | last post by:
I have a textbox that displays money amounts as 999999999.99. The user would like the keyer to either type in a decimal point or, if one is NOT supplied, imply one. Furthermore, when the textbox is populated from the database using a money datatype, it is four decimals to the right, which must be formatted to two. So, as far as keying, if a user (as an extreme) types in the following, they should diplay as: 1 display as 0.01
7
8090
by: meh | last post by:
This should wotk I think but its not trapping the Insert or Delete key??? Do I not have this written correctly? if (e.KeyCode == Keys.Insert) { MessageBox.Show("Pressed " + e.KeyCode); if (e.Control) { MessageBox.Show("Pressed " + e.KeyCode);
0
4278
by: Steph. | last post by:
Hi, I have made a new custom TextBox control to enable ENTER and TAB keys to be trapped in the "KeyPress" and "KeyDown" Events. to do that I have overridden the "IsInputKey" property in my new control (derived from the TextBox control)(see code below). I can now manage the KeyPress/Down event raised by TAB and ENTER keys, but I have one problem : A sound (ding) is played by my computer every time I press the TAB or ENTER key in...
1
6180
by: Rene | last post by:
Hi, I am running is some problems with the KeyPreview and KeyPress events. The KeyPress event is only triggered when there this an focusable control on the form. When all controls are disabled the Form.KeyPress event does not trigger anymore. A way to 'solve' this is to set the focus to the form, but during testing it happens ofter the keypress event is not getting triggered on keys like
10
27893
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? Tim
4
4533
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters anything into the textbox (for instance) I trap the keypress event to handle some stuff (i.e. if it is an enter key, etc). Now, once I am done with handling the keypress event for the textbox, I then need to pass that keypress event BACK to the...
12
6544
by: Todd Sparks | last post by:
I am using Visual Studio 2003 to develop a windows application in which I allow the users to just press Enter, while the focus is on a textbox, in order to perform a search. My problem is that sometimes Keypress event stops being raised. I have found that I can reproduce this behavior by performing a search, opening up another form, then trying to perform another search. The second search will NEVER work. How can I fix this problem? ...
5
2032
by: garyusenet | last post by:
I understand that Point is an object used for storing co-ordinates, such as mouse location. I can't figure out what the e's do in the above example can someone explain please. Thanks, Gary.
11
3266
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When my object is destroyed, I want my object to un-register this event. If I don't then the object would never be destroyed until the object I passed in the constructor is destroyed. I have implemented a Dispose(), Dispose(bool), and ~Finalize...
0
9575
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9407
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10015
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.