They are not the only way, one od the ways to do them...
VB6: Use Ascii values the way you want! Ex:
Option Explicit
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not KeyAscii >= 65 And KeyAscii < 90 Then
KeyAscii = 0
End If
End Sub
VB.NET: Use KeyPressed for validation...
'Textbox KeyPress
' Allow number 0-9 plus backspace, Del + Home + End will be accepted also
Dim ValidInputChar = "0123456789." + vbBack
If not ValidInputChar.Contains(e.KeyChar) then
e.KeyChar=Nothing
End If