vb怎样设定以回车键(或上、下、左、右键)控制光标从一个文本框跳到下一个文本框
2个回答
展开全部
只要将需要跳转的文本框获取焦点即可,如:
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyAscii
Case 13------------------'回车键
Textbox1.SetFocus
Case 38-41---------------'上/下/左/右键
Textbox2.SetFocus
Case else
End Select
End Sub
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyAscii
Case 13------------------'回车键
Textbox1.SetFocus
Case 38-41---------------'上/下/左/右键
Textbox2.SetFocus
Case else
End Select
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询