How to go to the next control?

  • Thread starter Thread starter Benson
  • Start date Start date
B

Benson

I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on A.
When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl(A).

Please help
Benson.
VB2005
 
Benson,

Strange why do you not know the Control name, don't you have the source?

The next control is the control with the next tab index.

Cor
 
What he is saying is that every control has a tab Index property.
Set these up for every control that you want to be focused on, in the
order that you want.
Then use that index to move from one control to the next.
 
Is this a web application or a windows forms?
If it's windows forms, then this is rather simple.
if its a Web application, you will need to use javascript to navigate
from one control to the next using javascript's Focus() function.

let me know if you need any other help...

regards,

Sorcerdon
 
Benson said:
I want to use code to move focus from the current control to the next
control (don't know the control name).
Example, there are texbox A and B, and a button. The current focus is on
A. When I press the button, the focus move from A to B with code. Somthing
like, GotoNextControl(A).

Check out the form's 'SelectNextControl' method.
 
Back
Top