Don't use
SendKeys
. Using key event simulation for UI development is usually considered as abuse; and I agree with that. Your example is just one to justify that.
In your case, just use
nextControl.Focus()
, because this is what you really want to achieve. Here,
nextControl
could be a reference to a control member of your form or other control, that is, some fixed control, but it also can find the next control automatically, the next one in the tab order of child controls:
Control.GetNextControl Method (Control, Boolean) (System.Windows.Forms)[
^].
—SA