devxlogo

Code All KeyPress Events in One Move

Code All KeyPress Events in One Move

Do you need to tab through all those edit boxes? Are you tired of coding all of their KeyPress events? If so, set the tab indexes as you normally would. Then set the form key preview to True. In the form KeyPress event, enter this code:

 If KeyAscii = 13 Then	SendKeys "{Tab}"	KeyAscii = 0End If

This will tab to all the controls, so if you don’t want to tab to a command button, set its tab stop to False.

devx-admin

Share the Post: