no go.... I have e.Handled set in every possible key event... I think it is going to have to be something beyond this.
Main Topics
Browse All TopicsI have a windows forms interface for a 3D engine. I use the W,A,S,D keys as movement keys for my free look camera but when pressing these keys I get constant "dings" it is very annoying. Does anyone have a way around this? In the OnKeyDown() event which I use for read the key I have tried setting the e.Handled property to true with no effect.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Another thing:
The above illustration works fine with non-Enter/Return keys, however, the Enter key has special function with text boxes their Multiline property set to true, it adds new line. The only way as I see is to change the property to true and then revert to false. The following code works fine with me, however, it makes the textbox shaking a bit:
C#:
if ((e.KeyCode == Keys.Enter || e.KeyCode==Keys.Return) && e.Modifiers==Keys.None)
{
txtFindWhat.Multiline = true;
txtFindWhat.Multiline = false;
btnFind_Click(null, null);
e.SuppressKeyPress = true;
}
I had the same problem as you and solved it based on the following:
You must do two things:
(1) Create an event that will handle the key press.
(2) Mark the original event (e) as handled (this will prevent the noise)
That's what the code does and it works without the need to change the Multi line property of a text box.
Business Accounts
Answer for Membership
by: jaime_olivaresPosted on 2008-04-02 at 16:30:16ID: 21268503
try to set e.Handled in the KeyPress event.