Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving to Next Textbox with Enter
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01291834
Message ID:
01291851
Views:
7
>Is there a single property setting for Textbox that controls whether Enter (CR) moves to the next control (loses focus)? Right now only Tab moves you to the next control.
>
>Or do I have to code it in the KeyPress event checking for 13?
>
>If I need to code it in Keypress, what command/method do I use to advance it to the next control?
>
>Thank you in advance.

Something like this should work:
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
	if (e.KeyChar == (char)Keys.Enter)
	{
		this.SelectNextControl((TextBox)sender, true, true, true, true);
	}
}
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform