Mas Budi coba pakai coding dibawah ini. Jadi kita tidak perlu membuang waktu
hanya untuk mengetik code pada setiap event KeyDown atau KeyPress dari
setiap text box yang ada.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys vbTab
End If
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
_____
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Budi Mulyono
Sent: 06 Februari 2008 12:48
To: [email protected]
Subject: [Programmer-VB] Tanya TextBox tombol ENTER bisa seperti TAB
Teman2,
bagaimana caranya supaya di TextBox penekanan tombol ENTER bisa seperti TAB
Selama ini saya pakai seperti ini :
jadi tiap TextBox selalu di beri perintah SendKeys "{Tab}"
bisa tidak, perintah itu di setting 1 kali saja, sehingga kalau tekan enter
langsung ke TextBox berikutnya tanpa mengisi semua Text1_KeyPress dengan
SendKeys "{Tab}" ?
Terima kasih
Budi
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{Tab}"
KeyAscii = 0
End If
End Sub
Best Regards,
Budi Mulyono
[EMAIL PROTECTED]
_____
Never miss a thing. Make Yahoo
<http://us.rd.yahoo.com/evt=51438/*http:/www.yahoo.com/r/hs> your homepage.