Crouchie, Works as advertised for a textbox but I was looking for a Form
event. I have several textboxes on my form and need the key event to do
some work that reloads all the boxes. If I place the example code under the
KeyDown event for the Form nothing happens. Suspect that is something to do
with the focus which remains in the textbox and the Form event is never
fired.
Ed
"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
Add a textBox & then add this code:
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.PageDown Then
MessageBox.Show(e.KeyValue)
End If
If e.KeyCode = Keys.PageUp Then
MessageBox.Show(e.KeyValue)
End If
End Sub
PageUp = 33
PageDown = 34
Crouchie1998
BA (HONS) MCP MCSE