hi friends
i have 2 form on my project.in the secend form has this controls :
1- 5 textbox that add to form at runtime (TextBox(1) , TextBox(2) , .... )
2- 2 button that add at design time (Button1 and Button2)
i set button1 as AcceptButton property for the form.
now i want each time the form is load the first TextBox (Textbox(1) ) get focus . i use this code on FormLoad event :
first time that i open this form Textbox(1) is focused . but if i click Button1( that set for AcceptbButton for this form) and close the form , next time that i open form Textbox(1) is not selected. only Button1 is selected. how can i set focus for Textbox(1) for each time i open the form?
i have 2 form on my project.in the secend form has this controls :
1- 5 textbox that add to form at runtime (TextBox(1) , TextBox(2) , .... )
2- 2 button that add at design time (Button1 and Button2)
i set button1 as AcceptButton property for the form.
now i want each time the form is load the first TextBox (Textbox(1) ) get focus . i use this code on FormLoad event :
VB.NET:
Textbox(1).setFocus
first time that i open this form Textbox(1) is focused . but if i click Button1( that set for AcceptbButton for this form) and close the form , next time that i open form Textbox(1) is not selected. only Button1 is selected. how can i set focus for Textbox(1) for each time i open the form?