First Control in Tab Order

  • Thread starter Thread starter Rachel Suddeth
  • Start date Start date
R

Rachel Suddeth

I can't believe I am finding this so hard to figure out...
I see there is a Controls.GetNextControl() (in Windows Forms controls) to
get the next control in the tab order. But I don't see how to get the first
one? Typically, I want to set focus to the first control on a certain tab
page or other panel. I must be missing something simple, right?

Thanks,
Rachel
______________________________________________________________

Roydan Enterprises Ltd
602 North 9th Street
Manitowoc, WI 54220-3924
 
Hi Rachel,

Control firstControl = Controls.GetNextControl(null, true);

I would probably set TabIndex of the various controls instead, so
selecting a tab page would automatically focus on the item with the lowest
TabIndex.
 
Hello.

I don't get it. The Controls object doesn't have a GetNextControl method, or
am I looking at the wrong place?

Is it the Form's Controls property that you mean, or is it something else?

- Niklas
 
Back
Top