Chinaunix首页 | 论坛 | 博客
  • 博客访问: 25797
  • 博文数量: 50
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 455
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-23 14:08
文章分类

全部博文(50)

文章存档

2024年(6)

2023年(22)

2022年(22)

我的朋友

分类: Windows平台

2023-08-18 16:15:26

Private Sub Text4_KeyPress(KeyAscii As Integer)
'''''''只允许输入数字及小数点
If KeyAscii = 13 Then SendKeys "{tab}"
If Not (Chr(KeyAscii) Like "[0-9.]" Or KeyAscii < 32) Then
KeyAscii = 0

If KeyAscii = 13 Then
Text4.SelStart = 0
Text4.SelLength = Len(Text4.Text)
End If
End If
End Sub

'''''''''只允许输入数字
Private Sub txt_qty_KeyPress(KeyAscii As Integer)
If Not (Chr(KeyAscii) Like "[0-9]" Or KeyAscii < 32) Then       ''''''只能输入数字,不能输入小数点及其它
'MsgBox "请输入数字!"
KeyAscii = 0
End If
End Sub
阅读(71) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~