How to make a control Tab to the next control when pressing Enter key?


How to make a control Tab to the next control when pressing Enter key?...
Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi All,

I am creating a VB version of the Currency Control created by Rogerio Mauri here http://forum.strataframe.net/Topic14533-26-1.aspx

Basically I have a whole bunch of currency fields and need a simple solution to all of them. I would like that when the user press the Enter key if will simply go to the next control like the Tab key does.  I found the following code in the Internet:

Private Sub CurrencyTextbox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

     'Tab to the Next Control when presing Enter

     If e.KeyCode = Keys.Return Then

          SendKeys.Send("{TAB}")

     End If

End Sub

It is working fine, but obviously this will fire for every key pressed in the control, is this the correct event to handle that feature, or is there another way to get this done?

P.S.

I will post the final version of this class when done.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search