I have a keydown event that looks like this
VB Code:
If e.KeyCode <> Windows.Forms.Keys.Up And e.KeyCode <> Windows.Forms.Keys.Down And e.KeyCode <> Windows.Forms.Keys.Enter Then Me.txtSearchBox.Focus() Me.txtSearchBox.Text = e.KeyCode.ToString Me.txtSearchBox.SelectionStart = 1 End If
This works fine, except for when you use the number pad. For instance, if you hit '2' on the number pad, the textbox would show 'NumPad2'. I want it to just display the '2'. I have tried e.KeyCode, e.KeyData, e.KeyValue, and all of their ToString() functions, but none of them return what I want. Does anyone know how I can fix this?
Thanks for any help!




Reply With Quote