probably a simple one, have a dozen textboxes that each contain one character. i’m try to process the delete key to clear the current text in the current textbox, then i want it to decrement the tab index by go and go back to edit the previous textbox. i don’t know how to reference the current textbox’s tab index and go back one. to go to the next one i’m merely performing a send key for ‘TAB’.
in my keyprocess function i have:
//DEL goes back one text box and clears it
if (keyData == (Keys.Delete))
{
//Clear textbox
//Go back one textbox to edit
return true;
}
again once i finished editing a text box i am sending:
SendKeys.Send("{TAB}");
maybe there is a better way to do this.
You can find the previous
TextBoxwith the GetNextControl method:Or as @Mr Lister suggested you can send the SHIFT+TAB key combination with:
SendKeys.Send("+{TAB}");but it’s a little hacky solution.