你可以用AscII码的大小范围来控制字符的输入即可以了,我过去用过的,你可以试一试!

解决方案 »

  1.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)    Dim strValid As String    If KeyAscii = 13 Then
            If Len(txtNo.Text) = 6 Then SendKeys "{Tab}"
            KeyAscii = 0
        End If    strValid = "abcdefghijklmnopqrstuvwxyz" & _
            Chr(vbKeyBack) & "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        If InStr(strValid, Chr(KeyAscii)) = 0 Then
            KeyAscii = 0
        End IfEnd Sub