|
沙发

楼主 |
发表于 2019-5-4 12:31:57
|
只看该作者
- Public Function TextFilter(fAsc As Integer, fMode As Integer) As Integer
- On Error GoTo ErrorHandle
- Select Case fMode
- Case NumOnly 'Number Only
- TextFilter = IIf(fAsc >= 48 And fAsc <= 57 Or fAsc = 8, fAsc, 0)
- Case NumPoint 'Number & char '.'
- TextFilter = IIf(fAsc >= 48 And fAsc <= 57 Or fAsc = 46 Or fAsc = 8, fAsc, 0)
- Case NumTime 'Number & char ':'
- TextFilter = IIf(fAsc >= 48 And fAsc <= 57 Or fAsc = 58 Or fAsc = 8, fAsc, 0)
- Case AlphaCap 'Alpha Caption
- If fAsc = 39 Then fAsc = 0
- TextFilter = IIf(fAsc >= 97 And fAsc <= 122, fAsc - 32, fAsc)
- End Select
- Exit Function
- ErrorHandle:
- MsgBox Err.Description, vbCritical
- End Function
复制代码 |
|