| | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 3:29:20 PM Posts: 400, Visits: 1,612 |
| | 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 IfEnd 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 RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:13:06 AM Posts: 4,104, Visits: 4,176 |
| | You will want to look at the SelectNextControl method of a control or a form. It selects the next control based on the tab order. For example: MyTextBox.SelectNextControl() |
| |
|
|