|
-
October 18th, 2000, 06:36 AM
#1
VbReturnKey
is it possible to filter the keyboard to accept only numeric at the same time traping the vbreturnkey
for example:
Private Sub Text1_Keyup(Keycode As Integer, shift As Integer)
Dim lstitem As ListItem
If Keycode = vbKeyReturn Then SendKeys "{tab}"
end sub
thanks for any help.
usin
-
October 18th, 2000, 07:15 AM
#2
Re: VbReturnKey
in order to trap Returns trap the KeyPress event and query the KeyAscii parameter for vbKeyReturn
-
October 18th, 2000, 10:41 AM
#3
Re: VbReturnKey
thanks for your reply,
i tried to make the text2 respond to uparrowkey which is, when the uparrowkey is press the cursor will go up to the previous text1. can you help me solve this problem? the following code is not working for uparrowkey
Private Sub text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Or KeyAscii = 13 Then 'you can press backspace and enter (search the ascii code for enter key cannot find it now)
SendKeys "{tab}"
End If
If KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
End Sub
Private Sub text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Or KeyAscii = 13 Then 'you can press backspace and enter (search the ascii code for enter key cannot find it now)
SendKeys "{tab}"
End If
If KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
If KeyAscii = vbKeyUp Then SendKeys "+{tab}"
End Sub
-
October 18th, 2000, 10:59 AM
#4
Re: VbReturnKey
If KeyAscii = vbKeyUp then text1.setfocus
:-)
Michael Vlastos
Automation Engineer
Intracom, Research & Development Division
Development Programmes Department
Athens, Greece
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|