I am working in Windows Form framework of c# , i have developed a form consisting of two textboxes (name and address). Problem is when i start my application focus is on address rather then name, how can i change this settings? Thank you in advance.
-
Get the Load-Event and in this event call tbName.Focus() or you can change the tab-order in the form.Tomtom– Tomtom2012-08-29 07:22:11 +00:00Commented Aug 29, 2012 at 7:22
-
i have tried tab order, name box has 1 and address is 2 ... Still not working.greatmajestics– greatmajestics2012-08-29 07:23:24 +00:00Commented Aug 29, 2012 at 7:23
-
Do you want the focus or the access for user input?lorenz albert– lorenz albert2012-08-29 07:26:57 +00:00Commented Aug 29, 2012 at 7:26
Add a comment
|
5 Answers
In Form_Load event call:
yourTextBox.Focus();
You may look at Control.Focus() on msdn
You may also look at this article to Set the Tab order if you don't want to use Focus()
1 Comment
greatmajestics
All Are best answers, but this one is the best in all. :) Thank You Very Much.