B
Bob Achgill
When I use the code for KeyPress to capture pressing a
certain key for processing on a form with no Text Box it
works.
But when I try the same code on my application that has
text boxes it does does not work.
How can I capture the cursor left and right keys for
processing?
Bob
+++++++++++++++
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal
e As System.Windows.Forms.KeyPressEventArgs) Handles
MyBase.KeyPress
' The keypressed method uses the KeyChar property
to check
' whether the ENTER key is pressed.
' If the ENTER key is pressed, the Handled
property is set to true,
' to indicate the event is handled.
If e.KeyChar = Microsoft.VisualBasic.ChrW(65) Then
e.Handled = True
MsgBox("The following key was depressed " +
ChrW(65)) ' Display message that the " " was pressed
End If
End Sub
certain key for processing on a form with no Text Box it
works.
But when I try the same code on my application that has
text boxes it does does not work.
How can I capture the cursor left and right keys for
processing?
Bob
+++++++++++++++
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal
e As System.Windows.Forms.KeyPressEventArgs) Handles
MyBase.KeyPress
' The keypressed method uses the KeyChar property
to check
' whether the ENTER key is pressed.
' If the ENTER key is pressed, the Handled
property is set to true,
' to indicate the event is handled.
If e.KeyChar = Microsoft.VisualBasic.ChrW(65) Then
e.Handled = True
MsgBox("The following key was depressed " +
ChrW(65)) ' Display message that the " " was pressed
End If
End Sub