TEXT框中输入货币格式问题

flashrain 2004-05-06 03:48:21
如何让TEXT里只允许输入货币格式,比如数字和小数点
...全文
147 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
onlineboy 2004-05-07
  • 打赏
  • 举报
回复
也可以在text1_keypress过程中判断
CAnders 2004-05-07
  • 打赏
  • 举报
回复
isnumeric
sysmaster 2004-05-07
  • 打赏
  • 举报
回复
调为:
bool = Chr(KeyAscii) Like "[0-9.]" Or KeyAscii = 8
sysmaster 2004-05-07
  • 打赏
  • 举报
回复
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim bool As Boolean
bool = Chr(KeyAscii) Like "[1-9 .]" Or KeyAscii = 8
If Not bool Then
KeyAscii = 0
End If
End Sub
jian_aa 2004-05-07
  • 打赏
  • 举报
回复
Private Sub Text1_KeyPress(KeyAscii As Integer)
If InStr("0123456789." + vbBack, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End Sub
huangchunhong 2004-05-07
  • 打赏
  • 举报
回复
用这个 IsNumeric 函数

7,765

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧