Source code berikut ini digunakan untuk berpindah textbox ke textbox lain atau dari object satu ke object yang lain dengan menekan enter kursor akan berpindah.
Buat suatu project dengan :
1 Form
4 TextBox (Input Properties Index masing-masing textbox, dimulai dari 0,1,2,3)
Copy source code berikut pada Form :
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Buat suatu project dengan :
1 Form
4 TextBox (Input Properties Index masing-masing textbox, dimulai dari 0,1,2,3)
Copy source code berikut pada Form :
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Tidak ada komentar:
Posting Komentar