ethnarch
asked on
how do you get the cursor into a textbox on form load
By default it seems all programs don't put the cursor into the textbox when the form loads and consequently you have to click into the textbox.
So how do i get the cursor in there so that the user no longer has to click into the textbox when the form loads?
So how do i get the cursor in there so that the user no longer has to click into the textbox when the form loads?
Set the Tabindex in the order you want the cursor to go from cotrol to control
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also to hide the tabindex number from the design form click View->Tab Order
can't you just do textbox1.focus()
Much easier to do it at design time through the GUI then to put a number of TextBox##.Focus() in the code especially if someone would like to change the order after you are done. But it is a matter of preference.
ASKER
I tried it through textBox1.focus() and it did not work maybe in code the textbox was in focus but it doesn't make the cursor appear.
ASKER
setting the tabindex to 0 does not work either or 1 i tried both and neither puts the cursor in the textbox i want
ASKER
ahh i see why none of this stuff worked i forgot about the tabindex of the group now i feel really stupid
ASKER
so thanks to fernando
Qoute: An easy way to set tab order is in the design window click on the form then from the menu View->Tab Order. The just click on each control in the order the you want the controls to be selected by pressing the tab key. When the program first starts it will go to tab index 0.
Qoute: An easy way to set tab order is in the design window click on the form then from the menu View->Tab Order. The just click on each control in the order the you want the controls to be selected by pressing the tab key. When the program first starts it will go to tab index 0.