Sometimes when we operate a program, we want to make the next control gain focus when we press the Enter key instead of clicking the mouse or pressing the TAB key. The specific principle is relatively simple, that is, when the user presses the Enter key (KeyAscii is 13), Send simulates pressing a Tab key. The specific source code is as follows:
Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys {tab}
KeyAscii = 0
End If
End Sub