I have a few textboxes. I'd like to point the user each time to the next textbox, on pressing enter. Textboxes have Tabindex set up correctly.
I got something like:
private void textBox_Description_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
e.Handled = true;
setFocusOnNextElement(sender);
}
}
How should setFocusOnNextElement look like? If i want to make it general. I could parse each control, and find what's next, but I have a feeling that this can be done nicer.