Converting Enter key to Tab Question

G

Guest

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
 
S

ShaneO

Terry said:
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.
 
G

Guest

Thanks!
--
Terry


ShaneO said:
Replace -

e.Handled = True
to
e.SuppressKeyPress = True


ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top