473,398 Members | 2,113 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,398 software developers and data experts.

OnKeyUp anomaly

Using VS .NET 2003 on an up-to-date XP Pro machine:

I'm getting bizarre results in a VB Windows app trying to implement the
OnKeyUp event handler. I have a form with a label control and code simialr
to the following:

Protected Overrides Sub OnKeyUp(ByVal e As
System.Windows.Forms.KeyEventArgs)

Select Case e.KeyCode
Case Keys.Up
lblKeyVal.Text = "Up Arrow"
Case Keys.Enter
lblKeyVal.Text = "Enter"
Case Keys.Escape
lblKeyVal.Text = "Escape"
End Select

End Sub

When I run this code on a sample project with no other code in it it seems
to run fine. However, when I place this identical code into my development
project, strange things happen. When I press either the *Enter* or the
*Escape* key, it works as expected. However, as soon as I press the *Up
Arrow* key, the program ceases to respond to key presses. If I place a
breakpoint at the first line of the Sub, it breaks there for every *Enter*
and *Escape* keypress until the first time I press the *Up Arrow*. Pressing
the *Up Arrow* does not result in execution halting at the breakpoint, and
afterwards the *Enter* and *Escape* keys also fail to activate the
breakpoint.

Any ideas???

TIA

William Barnes
Nov 21 '05 #1
2 1799
William Barnes wrote:
Using VS .NET 2003 on an up-to-date XP Pro machine:

I'm getting bizarre results in a VB Windows app trying to implement the
OnKeyUp event handler. I have a form with a label control and code simialr
to the following:

Protected Overrides Sub OnKeyUp(ByVal e As
System.Windows.Forms.KeyEventArgs)

Select Case e.KeyCode
Case Keys.Up
lblKeyVal.Text = "Up Arrow"
Case Keys.Enter
lblKeyVal.Text = "Enter"
Case Keys.Escape
lblKeyVal.Text = "Escape"
End Select

End Sub

When I run this code on a sample project with no other code in it it seems
to run fine. However, when I place this identical code into my development
project, strange things happen. When I press either the *Enter* or the
*Escape* key, it works as expected. However, as soon as I press the *Up
Arrow* key, the program ceases to respond to key presses. If I place a
breakpoint at the first line of the Sub, it breaks there for every *Enter*
and *Escape* keypress until the first time I press the *Up Arrow*. Pressing
the *Up Arrow* does not result in execution halting at the breakpoint, and
afterwards the *Enter* and *Escape* keys also fail to activate the
breakpoint.

Any ideas???

TIA

William Barnes


Are you handling anything in the OnKeyDown or ProcessCmdKey events?

Chris
Nov 21 '05 #2
No, the only overrides are this one and OnPaint()
William
"Chris" <no@spam.com> wrote in message
news:%2*****************@TK2MSFTNGP09.phx.gbl...
William Barnes wrote:
Using VS .NET 2003 on an up-to-date XP Pro machine:

I'm getting bizarre results in a VB Windows app trying to implement the
OnKeyUp event handler. I have a form with a label control and code
simialr to the following:

Protected Overrides Sub OnKeyUp(ByVal e As
System.Windows.Forms.KeyEventArgs)

Select Case e.KeyCode
Case Keys.Up
lblKeyVal.Text = "Up Arrow"
Case Keys.Enter
lblKeyVal.Text = "Enter"
Case Keys.Escape
lblKeyVal.Text = "Escape"
End Select

End Sub

When I run this code on a sample project with no other code in it it
seems to run fine. However, when I place this identical code into my
development project, strange things happen. When I press either the
*Enter* or the *Escape* key, it works as expected. However, as soon as I
press the *Up Arrow* key, the program ceases to respond to key presses.
If I place a breakpoint at the first line of the Sub, it breaks there for
every *Enter* and *Escape* keypress until the first time I press the *Up
Arrow*. Pressing the *Up Arrow* does not result in execution halting at
the breakpoint, and afterwards the *Enter* and *Escape* keys also fail to
activate the breakpoint.

Any ideas???

TIA

William Barnes


Are you handling anything in the OnKeyDown or ProcessCmdKey events?

Chris

Nov 21 '05 #3

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

Similar topics

3
by: Trent | last post by:
Hi. I know the basic way to assign event handlers: <input onKeyUp="processEvent(event)" /> But how do I assign a function to the onKeyUp event in *javascript* that can access the event...
2
by: Evan Wong | last post by:
I have problem to get onkeyup event. If we put the event in HTML statement like - "<input name=field1 size=16 onkeyup="javascript:function1();>" it works. If we put in JavaScript code like...
2
by: greg | last post by:
hello i would like to apply an onkeyup event to every element of my form in order to do that, i would use the array form.elements, doing something like that : ...
2
by: john.lum | last post by:
My overall objective is to create something akin to Google Suggest, where a query is done in response to changes in a text field presented to the user. I've got things working using the onkeyup...
3
by: Brad | last post by:
The first text on my form is a numeric field. I have a javascript that runs on this field for onkeyup (validate the key strokes and modifies fields on the screen) but when I do this and have the...
13
by: Lee | last post by:
I have this function that doesn't work. I pass it the td element and an id, and it makes an input field inside the td. That part workds. What doesn't work is that I want to add an "onkeyup" on...
1
by: mai | last post by:
Hi everyone, i'm trying to exhibit FIFO anomaly(page replacement algorithm),, I searched over 2000 random strings but i couldnt find any anomaly,, am i I doing it right?,, Please help,,,The...
2
by: mc | last post by:
Can someone suggest how I would add a new trigger such that when the JS event onkeyup in a textbox the updatePanel refreshes? If not could someone sugest how I could onkepup in a Textbox, refresh...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.