Click here to Skip to main content
15,887,361 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have few TextBoxes. When i say "Up" arrow in the TextBoxes it should work as "Shift+Tab" functionality i.e cursor should switch to previous indexed TextBox.
I'm able to work perfectly with code
C#
private void txtdeposit_KeyDown(object sender, KeyEventArgs e)
{
  if (e.KeyCode == Keys.Up)
   {
    SendKeys.Send("+{TAB}");
   }
}


But the issue is when there is text in any textbox then "Up" arrow functionality is not working. But I'm able to work when there's no text...Suggest me....
Posted
Updated 30-Oct-10 1:13am
v2

1 solution

There is a way to do what you are currently doing without resorting directly to SendKeys, or any other API function.

Take a look at Control.GetNextControl[^].

The reason that I said 'resorting directly' is that I suspect that the method uses SendKeys down in the bowels. Therefore I am not sure that it will solve your problem. Still, give it a try, you never know.

Good luck. :)
 
Share this answer
 
Comments
krishna kishore58 2-Nov-10 4:56am    
sorry it's not working...can any 1 suggest me...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900