By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,623 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,623 IT Pros & Developers. It's quick & easy.

Converting Enter key to Tab Question

P: n/a
This should be simple. Converting an app where the users expect the Enter
key to take them to the next textbox. So in the Forms KeyPress event I have
the following code:

If e.KeyCode = Keys.Enter Then
If e.Shift Then
SendKeys.Send("+{TAB}")
Else
SendKeys.Send("{TAB}")
End If
e.Handled = True
End If

This works as I would have expected, except for one minor detail...the
system 'Beeps' when the the Enter key is pressed. There is no beep when the
Tab key is pressed. What is causing this and what can I do to stop it?
Terry
Sep 15 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Terry wrote:
This should be simple. Converting an app where the users expect the Enter
key to take them to the next textbox. So in the Forms KeyPress event I have
the following code:

If e.KeyCode = Keys.Enter Then
If e.Shift Then
SendKeys.Send("+{TAB}")
Else
SendKeys.Send("{TAB}")
End If
e.Handled = True
End If

This works as I would have expected, except for one minor detail...the
system 'Beeps' when the the Enter key is pressed. There is no beep when the
Tab key is pressed. What is causing this and what can I do to stop it?
Terry
Replace -

e.Handled = True
to
e.SuppressKeyPress = True
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Sep 15 '07 #2

P: n/a
Thanks!
--
Terry
"ShaneO" wrote:
Terry wrote:
This should be simple. Converting an app where the users expect the Enter
key to take them to the next textbox. So in the Forms KeyPress event I have
the following code:

If e.KeyCode = Keys.Enter Then
If e.Shift Then
SendKeys.Send("+{TAB}")
Else
SendKeys.Send("{TAB}")
End If
e.Handled = True
End If

This works as I would have expected, except for one minor detail...the
system 'Beeps' when the the Enter key is pressed. There is no beep when the
Tab key is pressed. What is causing this and what can I do to stop it?
Terry

Replace -

e.Handled = True
to
e.SuppressKeyPress = True
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Sep 15 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.