tags:

views:

139

answers:

2

I need to get a handle to whichever control has the minimum TabIndex. I've tried using GetNextDlgTabItem() and passing a 0 pointer for the second argument, but the returned handle isn't always the first one in the screen's tab order. Thoughts?

+2  A: 

Dirty method: Try looping through your collection of controls and keep track of the one with the smallest tab index, when the loop is complete you should be able to return the index of the control in that collection with the smallest tabindex property.

TheTXI
Thank you :o) I was hoping for something a little cleaner... if I can't come up with anything that's probably what I'll end up having to do
Tina Orooji
A: 

I ended up keeping track of which field got focus on load and then just setting focus back to that when needed.

Tina Orooji