dineshkumaar
Member
- Joined
- Jun 5, 2009
- Messages
- 21
- Programming Experience
- 10+
Hello everybody
I have a Data Entry form. I wanted to make the Enter key work like TAB key so that if a user presses Enter key, the next control should get the focus key.
For this, I used the Forms KeyPreview on and Form's KeyUp Event to trap the Enter key and used the SendKeys.Send("{TAB}"). The problem is that to open this form there is a MenuToolStripItem. If Selects this MenuToolStripItem by pressing enter (not mouse click), this Enter key is processed by the DataEntry Forms KeyUp event and the focus goes to the second object instead of the first one.
Another problem is that .. suppose there is a textbox TaxType. if user Types 1 and press Enter, It should jump to the VAT textbox. for this i used Vattextbox.focus event if the of TaxType.Valideted event. But the focus moves to the next control after VATtextbox. alternatively if user presses TAB in TaxType textbox then it goes properly to VATtextbox.
I am facing this problem every time where i need to make Enter key work as TAB since long time. Any suggestions.
Regards
Thanks.
I have a Data Entry form. I wanted to make the Enter key work like TAB key so that if a user presses Enter key, the next control should get the focus key.
For this, I used the Forms KeyPreview on and Form's KeyUp Event to trap the Enter key and used the SendKeys.Send("{TAB}"). The problem is that to open this form there is a MenuToolStripItem. If Selects this MenuToolStripItem by pressing enter (not mouse click), this Enter key is processed by the DataEntry Forms KeyUp event and the focus goes to the second object instead of the first one.
Another problem is that .. suppose there is a textbox TaxType. if user Types 1 and press Enter, It should jump to the VAT textbox. for this i used Vattextbox.focus event if the of TaxType.Valideted event. But the focus moves to the next control after VATtextbox. alternatively if user presses TAB in TaxType textbox then it goes properly to VATtextbox.
I am facing this problem every time where i need to make Enter key work as TAB since long time. Any suggestions.
Regards
Thanks.