# about Keypress的问题？

Posted by VB白痴 on January 29, 1999 at 01:00:22:

我在form上放了五个TextBox，希望能用上下键来移动，我的程式码如下，但是不能动，可否指点一、二！谢谢！
Private Sub Text1_keypress(keyascii As Integer)

Select Case keyascii
Case 13
SendKeys "{Tab}"
Case vbKeyDown
SendKeys "{Tab}"
Case vbKeyUp
SendKeys "{Shift}" + "{Tab}"
End Select
keyascii = 0

End Sub

Private Sub Text2_keypress(keyascii As Integer)

Select Case keyascii
Case 13
SendKeys "{Tab}"
Case vbKeyDown
SendKeys "{Tab}"
Case vbKeyUp
SendKeys "{Shift}" + "{Tab}"
End Select
keyascii = 0

End Sub

Private Sub Text3_keypress(keyascii As Integer)

Select Case keyascii
Case 13
SendKeys "{Tab}"
Case vbKeyDown
SendKeys "{Tab}"
Case vbKeyUp
SendKeys "{Shift}" + "{Tab}"
End Select
keyascii = 0

End Sub

Private Sub Text4_keypress(keyascii As Integer)

Select Case keyascii
Case 13
SendKeys "{Tab}"

Case vbKeyDown
SendKeys "{Tab}"

End Select
keyascii = 0

End Sub

Private Sub Text5_keypress(keyascii As Integer)

Select Case keyascii
Case 13
SendKeys "{Tab}"

Case vbKeyDown
SendKeys "{Tab}"

End Select
keyascii = 0
End Sub

Follow Ups:

- 试试写在 keyUp 笋子 01:57:17 1/29/99 (0)