473,614 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter Key ignored...REALL Y weird bug

This is so weird, and I cannot even isolate the cause enough to give any
clues as to how to reproduce the error, so this is probably a real shot
in the dark...

BUT, has anyone ever run into a situation where pressing the enter key
on a textbox control is NOT captured by the KeyPress event?

Now before you ask:

-- The form does NOT have a default button selected.
-- The form does have key preview set to true, but setting it to false
has no effect on this problem.
--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
9 1281
Hi Zorpie

I'm guessing that if you can cut your project down to the minimum set where
this problem still occurs, and you post it here, someone will be able to
spot the problem pretty quickly.

Charles
"ZorpiedoMa n" <No********@Bea tles.com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
This is so weird, and I cannot even isolate the cause enough to give any
clues as to how to reproduce the error, so this is probably a real shot
in the dark...

BUT, has anyone ever run into a situation where pressing the enter key
on a textbox control is NOT captured by the KeyPress event?

Now before you ask:

-- The form does NOT have a default button selected.
-- The form does have key preview set to true, but setting it to false
has no effect on this problem.
--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #2
Rud
Hi Zorpie,

I'm having similar problems. It's really strange: I have a picturebox
control and all KeyDown events are nicely catched by the forms KeyDown
routine. Only four keys are not catched: the four arrow keys...

How did you solve your enter key problem...???

Thanks, Rud.
"ZorpiedoMa n" <No********@Bea tles.com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
This is so weird, and I cannot even isolate the cause enough to give any
clues as to how to reproduce the error, so this is probably a real shot
in the dark...

BUT, has anyone ever run into a situation where pressing the enter key
on a textbox control is NOT captured by the KeyPress event?

Now before you ask:

-- The form does NOT have a default button selected.
-- The form does have key preview set to true, but setting it to false
has no effect on this problem.
--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #3
Rud -

Well, I never ended up finding the cause of my problem and found another
work around.

Your problem, however, is this: The arrow kesy (as well as pgUp, pgDn,
Home, End and a handful of others) is NOT captured by the keypress
event. You need to use the KeyDown or KeyUp event to catch these...

Good Luck.

--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #4
Rud
Thanks Zorpie,

I am using the KeyDown event and not KeyPress (see my mail)! The problem is
as followes: I have an MDI form with two child forms. No matter what I do to
trap the arrow key in the child form, pressing the arrow keys result in:
1) Focus is switched to the next (or previous) open MDI child window, and
2) The KeyDown event is not captured by the child forms KeyDown routine...
For sure "KeyPreview = true" is set for the child form.

I have solved issue 2) - such that I am trapping the arrow key event - as
follows:

Protected Overrides Function ProcessCmdKey(B yRef msg As
System.Windows. Forms.Message, ByVal keyData As System.Windows. Forms.Keys) As
Boolean
MsgBox(keyData)
MyBase.ProcessC mdKey(msg, keyData)
End Function

But I can not manage to stop the unwanted behaviour that pressing the arrow
keys also results in switching the focus from one MDI child form to the
other....

Thanks,

Rud.
"ZorpiedoMa n" <No********@Bea tles.com> wrote in message
news:OJ******** ******@tk2msftn gp13.phx.gbl...
Rud -

Well, I never ended up finding the cause of my problem and found another
work around.

Your problem, however, is this: The arrow kesy (as well as pgUp, pgDn,
Home, End and a handful of others) is NOT captured by the keypress
event. You need to use the KeyDown or KeyUp event to catch these...

Good Luck.

--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #5
oops, sorry for the dumb answer. I never went back and read your
comment... I was tired.

anyway, I can't even duplicate your problem. is the picture box the
ONLY control on the child forms?

--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #6
Rud
It was, I temporarely solved the whole problem by placing a "dummy" TextBox
on the form as well. I positioned it outside the form (0,-40) such that it
is invisible for the user. Disabeling did not solve the problem. So for some
reason as long as there is a control (textbox, or commandbutton) that has or
can have the focus all key events are raised. As soon as the picturbox is
the only control again the strange behaviour occurs...

Rud.
"ZorpiedoMa n" <No********@Bea tles.com> wrote in message
news:ec******** ******@TK2MSFTN GP09.phx.gbl...
oops, sorry for the dumb answer. I never went back and read your
comment... I was tired.

anyway, I can't even duplicate your problem. is the picture box the
ONLY control on the child forms?

--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #7
Rud -

You know, now that you describe your situation and your work around, I
remember years ago making that SAME discovery, even in VB6. I forget if
I ever found out why it behaves that way though. Anyway, good luck!
Looks like you are back on track now.

--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #8
Please try the KeyDown event, which can return the Key presed value.

Note
There is also the AcceptsReturn property of the text box, which is False
by default.

with regards,
J.V.Ravichandra n
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandra n+J.V.&cob=aspn etpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID= P3966388&BN=999 &PN=2
- Or, just search on "J.V.Ravichandr an"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #9
Zorpiedo Man,

Calling somethig a "bug" needs a good documented explanation of what
something should do confirm the documentation and a sample to reproduce the
bug.

When you can not produce that, you can call it only a bug in your programma
and than you should write that in the subject of this message in my opinion.

Now you give me the idea that you only want to blamme the programmers from
Microsoft with your own incapacity.

Not saying that it is as I wrote above, however in the way you do this
giving me strongly the idea.

And than it is not nice in my opinion.

Cor

"ZorpiedoMa n"
...
This is so weird, and I cannot even isolate the cause enough to give any
clues as to how to reproduce the error, so this is probably a real shot
in the dark...

BUT, has anyone ever run into a situation where pressing the enter key
on a textbox control is NOT captured by the KeyPress event?

Now before you ask:

-- The form does NOT have a default button selected.
-- The form does have key preview set to true, but setting it to false
has no effect on this problem.
--Zorpie

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #10

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

Similar topics

5
2098
by: Alan Zhong | last post by:
i am trying to similate an "ENTER" as a key to switch focus in a sequence of text inputs. i don't want to use "event.keyCode" since i want to do additional testing before i decide which text input i want to focus next. the following are the test code i have, whenever i hit "enter", it will act clicking the submit button. what can i do to avoid this problem? <!-- ############# code begins here ############ --> <html> <head>
1
2758
by: Tony LaPaso | last post by:
Hi All, I hope I am not "over-posting" to this group. I'm coming up to speed on CSS and so questions come along. This seems too weird. For some reason, Firefox 1.0.4 (as well as IE 6/Win) is ignoring my 'border-width' in the code below. No matter what I set it to, it is ignored. If I use the full "border:" notation, everything works fine.
9
4862
by: Jaxon Bridge | last post by:
This is really weird, and is a problem only on IE 6 for me, but not Firefox. Here is the code: <td colspan=3 class=allmessagesheader>Pictures from Europe<br><br><br>December 10, 2000</td> Looks pretty basic, right? Well, the second <br> tag in there is ignored. If I have only one <br> tag, it behaves as usual. The second
37
3532
by: thierry38080 | last post by:
Hi, I created a CSS that work fine on my IE 6.0.2900 (SP2) but I'm having customers that have problems with it and they're on IE 6.0.2800 (SP1)... The problem looks like if the stylesheet (in particular the class LigneTableau_Noir_SansHauteur) was ignored. Could you test this code on your browser and tell me if you see this particular points : - all cells have a left border of 1px black except cells "val3" and
0
1819
by: Tom Edelbrok | last post by:
I'm using VS 2005 to develop an intranet asp.net web application and I get a weird situation. If I start out with any ASPX page that contains an ImageButton control followed by a TextBox control, everything works okay. I can press <ENTER> when the cursor is inside the text box and the page is running, and no events fire (this is what I expect). But as soon as I drop a second text box on the page (ie: after th first one) then pressing...
3
2286
by: GS | last post by:
If I were to capture enter key on keyup event of an GUI object like comboBox box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert, shiftdelete, contrl-insert
0
1822
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this code SHOULD do: - read new (=updated) licensetext from file $license_path then - read and modify recursively all files from $current_dir, replacing old
10
5517
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if pressed, submit the form - bypassing my onclick handler. I can partially fix this with: <form onsubmit='return false;'>
2
1667
by: Sunfire | last post by:
I was wondering if there was a way to hit enter to insert blank lines while in the designer? I tried this but all it seems to want to do is insert code that really shouldn't be there. For example, I had a heading 1 centered on a page. Right under that I had some words in smaller print right under the heading. When I hit enter after the heading 1, it automatically put the text right below it in a <p></ptag. I don't want this sort of stuff to...
0
8591
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
8294
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8444
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7115
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
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
4138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
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.