Live Chat Icon For mobile
Live Chat Icon

How can I make the focus move to the next control when the user presses the Enter key in a TextBox

Platform: WinForms| Category: TextBox

Add a handler for your TextBox’s KeyDown event. (This assumes you set the AcceptsReturn property to False).

Then in your KeyDown eventhandler, have code such as:

	if (e.KeyCode = Keys.Enter)
	If e.KeyCode = Keys.Enter Then

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.