Reputation: 1771
I tab out from a TextBox and then get an error message due a some validation failure. I press the 'Ok' button acknowledging the error message. Then focus goes on to the next control. How can we have the focus remain on the original TextBox after error has been acknowledged?
Upvotes: 0
Views: 149
Reputation: 1786
Assuming your text box name txtMybox, you can set the focus of the textbox as follows
txtMybox.Focus()
Upvotes: 2