954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Focus on textBox?

Hi i am making a window application
in which i want to know that when my application is start, so it should automatically get focus on textBox, how can i do that.........
Kindly help me in this...............?

avirag
Posting Whiz
313 posts since Jun 2009
Reputation Points: 31
Solved Threads: 36
 

If you are using Visual Studio you can edit the tab order of the controls.
The TextBox with the lowest tab order will recieve the focus.
Select tab order editing in the View menu.

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 
If you are using Visual Studio you can edit the tab order of the controls. The TextBox with the lowest tab order will recieve the focus. Select tab order editing in the View menu.

Thanks for your reply ddanbe,
But i have already done this, it did not worked for me........
when application start, it is not focusing automatically to textBox.
i.e. the cursor automatically comes in the textbox........
how can i change that tab order
Kindly help me in this..........

avirag
Posting Whiz
313 posts since Jun 2009
Reputation Points: 31
Solved Threads: 36
 

Set the textbox' tab order to zero. Just click the number you see, set other controls accordingly. To leave tab order mode, just click View menu tab order again. Should work, succes!

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

Hi Avirag,
You can use the following code on form_load event :

this.textBox1.Focus();


Hope it works............
GudLuck

vinnijain
Junior Poster
145 posts since Jul 2009
Reputation Points: 11
Solved Threads: 12
 

Hi Avirag, You can use the following code on form_load event :

this.textBox1.Focus();

Hope it works............ GudLuck

Thanks vinnijain for your reply, but it is not working, i have already tried this.........

avirag
Posting Whiz
313 posts since Jun 2009
Reputation Points: 31
Solved Threads: 36
 
Set the textbox' tab order to zero. Just click the number you see, set other controls accordingly. To leave tab order mode, just click View menu tab order again. Should work, succes!


Thank you ddanbe.........
it's working ,my problem is solved now
thankyou once again

avirag
Posting Whiz
313 posts since Jun 2009
Reputation Points: 31
Solved Threads: 36
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: