473,385 Members | 1,536 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,385 software developers and data experts.

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 1854
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**************@TK2MSFTNGP15.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.ToString)

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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP15.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**************@tk2msftngp13.phx.gbl...
Are you sure the keypad keys with NumLock off cause a KeyDown event?

I have a

Debug.WriteLine("KEYDOWN " & e.KeyValue.ToString)

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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP15.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
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...
7
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...
0
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...
1
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...
10
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? ...
4
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...
12
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...
5
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.