setting the focus of controls

I have a question considering the IControlStatusConstants. If I have more than one control set to CS_ERROR, which control gets the focus? Is it the first one listed in the xml-file?

And am I able to control the setting of the focus?

Thanks in advance!
Agnes

…CS_ERROR is implicitly is requesting the focus. Use CS_ERROR_NO_FOCUS to highlight an error without requesting focus. Ie one of the bad fields receives CS_ERROR - the others CS_ERROR_NO_FOCUS.

Martin

Thanks for your quick answer.

But I set controls to CS_ERROR without knowing if other fields are bad, too. And now I would like to know which one will get the focus. The first one set bad, or the last one? I cannot find the policy in my application. It behaves differently in different cases.

Agnes

…it is just one of them (ie unpredictable). Of course the focus is not set by random into one of the fields - it is just the first within an internal registration (often this is the first visible field - but need not to be).

Martin