Click here to Skip to main content
15,887,386 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have few textboxes. When I hit "Up arrow", it should work as shift+tab i.e control should swith to previous tab index.
I'm able to do it when textbox is empty. But when textbox contains something, then control is not going to following code at all while debugging.

if (e.KeyValue == 38)
     SendKeys.Send("+{TAB}");


simply the cursor is moving from right to left through the text.
Posted
Updated 14-Nov-10 18:43pm
v2

1 solution

Key Up Event may helps you

try the below code

C#
private void textBox1_KeyUp(object sender, KeyEventArgs e)
    {
        textBox2.Focus();
    }
 
Share this answer
 
Comments
Rajesh Anuhya 15-Nov-10 1:21am    
Who is Voted it..1, can you explain how it is???
krishna kishore58 15-Nov-10 1:54am    
Yappi... its working but text available in previous textbox is getting focused but i dont require that i just wanna place cursor to the end of the text... suggest me...
Rajesh Anuhya 15-Nov-10 2:11am    
You already Know about the SendKey Methods(which is mentioned in your code).., Pass the Correct code to the Sendkey in the Keyupevent

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