我想在Form_KeyPress的控制窗体中的文本框只能输入数字,为何下面这样,不会执行到?
键盘输入的时候不会调到Form_KeyPress???Private Sub Form_KeyPress(Keyascii as integer)
select case Keyascii
case 13case else
If left(me.ActiveControl.Name,3)="Txt" then
'只能输入数字
End IfEnd Sub
键盘输入的时候不会调到Form_KeyPress???Private Sub Form_KeyPress(Keyascii as integer)
select case Keyascii
case 13case else
If left(me.ActiveControl.Name,3)="Txt" then
'只能输入数字
End IfEnd Sub
If Left(Me.ActiveControl.Name, 3) = "txt" Then
If KeyAscii > 60 Then KeyAscii = 0
End If
End SubPrivate Sub Form_Load()
Me.KeyPreview = True
End Sub
GotFocus和LostFocus又如何控制呢,我没有用控件数组