If you want to do something like this (which is usually frowned on; after all this is not really a chat room) you should use a subject line that will cause this post to be found through searches...
There is no reason to parenthesize the entire test statement...
Code:
If (AscW((CType(e.KeyChar, String)))) = 13 Then
' can be
If AscW(CType(e.KeyChar, String)) = 13 Then
(for instance.)
This could be a lot easier to read. Every test uses the same setup...
Code:
Dim Inp As Integer = AscW(CType(e.KeyChar, String))
Select Case Inp
Case 13 ' Allow enter to perform same as tab
txtRate.Focus()
Case 27 ' Allow Esc key to perform exit btn
btnExit.PerformClick()
Case 8 ' Allow BkSpc key to delete text
txtPrinciple.Text = ""
' Allow only nums & DPs to be entered
Case 46 ' Do nothing. Effectively the "Not" from the post
Case Else
If e.KeyChar < "0" _
Or e.KeyChar > "9" Then e.Handled = True
End Select