在KeyPress事件中判断KeyAscii是否小于1

解决方案 »

  1.   

    最简单、最实用、最符合设计准则的做法: 在那个Text的旁边放一个LABEL,写“请用中文输入”
      

  2.   

    uguess(uguess) 方法好,
    用户界面注重的是交互!
      

  3.   

    判断ASCII码是否小于"啊"的ASCII
      

  4.   

    If KeyAscii > 1 Then
    KeyAscii = 0
    End If
      

  5.   

    Validate里判断
    If LenB(StrConv(Text.Text, vbFromUnicode)) <> LenB(Text.Text) Then msgbox ....
      

  6.   

    中文的Ascii是负数
    可在keypress事件中判断keyascii是否小于0  If KeyAscii > 0 Then KeyAscii = 0
      

  7.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If (KeyAscii >= 33 And KeyAscii <= 125) Or KeyAscii = 128 Then
            KeyAscii = 0
        End If
    End Sub