Converting Enter key to Tab Question

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Back
Top