First Control in Tab Order

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
 
M

Morten Wennevik

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top