How to loop though controls on the form?

  • Thread starter Thread starter Ryan Liu
  • Start date Start date
R

Ryan Liu

How to loop though controls on the form?

I set each control's TabStop and TabIndex, but at run time, I press Tab key,
it jump though first control to last control and does not go back to the
first one unless I use Alt + Tab to go reverse direction.

How can I write C# code to allow user just to use Tab kek to loop though the
controls?

Thanks!
 
Hi Ryan,

You can use the Control.SelectNextControl function to navigate controls
programatically.

--
Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Default behaviour of controls is for Tab key to loop back through to the
first control, so something is not quite right. What else have you done to
the form?

Please post form code sample.

Br,

Mark.
 
Thanks for all the reply. It is really helpful.

Yes, I found the problem.

I was trying to use Tab key to loop though sub-controls in a user-control.
I set this user-control Tab stop to false so all sub-control it contains can
only be negativated once, not in a loop way.

Thanks all!
Ryan
 
Back
Top