470,855 Members | 1,227 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

For Setting Focus

i have 3 text box TxtFirstName,TxtMiddleName,t3 and 1 ComboBox cmbStatus
i have written code in TxtFirstName keypress event,key down event for get
the focus in TxtMiddleName by pressing Enter.
But when i press enter in TxtFirstName ,cursor will goto comboBox cmbStatus
not TxtMiddleName.
please help me i want to set focus in TxtMiddleName when i press enter in
TxtFirstName .
eg.
Private Sub TxtFirstName_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TxtFirstName.KeyDown
If e.KeyCode = 13 Then
TxtMiddleName.Focus()
End If
End Sub

Private Sub TxtFirstName_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TxtFirstName.KeyPress
If Asc(e.KeyChar) = 13 Then
TxtMiddleName.Focus()
End If
End Sub

Jun 8 '06 #1
0 824

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Arne | last post: by
2 posts views Thread by Mystery Man | last post: by
3 posts views Thread by Brian Henry | last post: by
7 posts views Thread by Zytan | last post: by
5 posts views Thread by Finn Stampe Mikkelsen | last post: by
3 posts views Thread by kelvin.koogan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.