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...............?

Recommended Answers

All 6 Replies

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.

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..........

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!

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

this.textBox1.Focus();

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

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.........

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.