修正楼上:
sub txt_focus(sender,e)handlers textbox2.enter,textbox1.enter '<--需要哪个textbox就由你决定了.
dim t as textbox=sender
t.selectionstart=t.textlength
end sub 'txt_focus
这样跳到两个textbox都会把插入点置的末尾.
从TXT1跳到TXT2实现如下:
Private Sub txt1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txt1.KeyUp
IF e.KeyCode=Keys.down THEN SendKeys.send("{TAB}")
End Sub
移动的顺序由textbox的index属性决定
到文本框尾部可用END代替TAB,不过文本有多行的情况下光标停留在第一行的尾部.