# Re: 请问关于转换SetFocus的问题!

Posted by styler on October 14, 1999 at 10:08:04:

In Reply to: 请问关于转换SetFocus的问题! posted by 风铃 on October 13, 1999 at 23:26:50:

: 我希望能在Textbox输入文字后，能把focus自动跳到另一个Textbox，我可以怎样运用Setfocus把focus自动换到另一个textbox呢 ?

你可以选text1的事件(这是按enter)
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

if keycode = vbEnter then
text2.setfocus
End Sub

或者写 (当text1.text长度大于N时)
Private Sub Text1_Change()
if len(text1.text) > N then
text2.setfocus
end if
End Sub

Follow Ups: