msdn查了半天没有找到

解决方案 »

  1.   

    private text1_lostfocus()
        if text1.text="" then
            msgbox "请输入整型数据!",48,"提示"
            text1.setfocus
            exit sub
        else
            if not isnumeric(text1.text) then
                msgbox "请输入数值型数据!",48,"提示"
                text1.setfocus
                exit sub
            else
                text1.text=int(text1.text)
            end if
        end if
    end sub
      

  2.   

    可以考虑用这种方法实现:Private Sub txtLimit_KeyPress(KeyAscii As Integer)
        Dim Numbers As String
        
        Numbers = "1234567890" + Chr(8) + Chr(46)
        If InStr(Numbers, Chr(KeyAscii)) = 0 Then KeyAscii = 0
    End Sub这样就只能输入数字了