为什么密码那个地方检验不能跳出msgbox啊?我想让密码必须是数字,要有长度控制。出错就用msgbox抱出来。急啊!
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) If KeyAscii > 47 And KeyAscii < 58 Then Exit Sub '0-9 If KeyAscii = 8 Then Exit Sub '退格 KeyAscii = 0 msgbox "请输入数字!"End SubMaxLength 属性 为长度限制
Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii > 47 And KeyAscii < 58 And Len(Text1) < 8 Then Exit Sub '0-9 If KeyAscii = 8 Then Exit Sub '退格
KeyAscii = 0 MsgBox "非法输入"End Sub