Text.text

解决方案 »

  1.   

    在text1.text中
    我想使輸入的字符串中不含有空格,括號隻能在英文下才能輸入!!
    否則就提示錯誤!!
    怎麼來判斷啊 !!
    望指教!!謝謝!!
      

  2.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = -23640 Or KeyAscii = -23639 Then
            MsgBox "括号必须为英文的!"
            KeyAscii = 0
        End If
        If KeyAscii = 32 Then
            MsgBox "不能输入空格!"
            KeyAscii = 0
        End If
    End Sub