>>In the Container I added two textboxes. First I add the "second" one and then the "first" one.
>>I give the TabIndex = 1 to the first textbox, which I added after the second.
>
>To keep it generic, could you add code in the container's SetFocus that iterates through the contained controls and
>sets the focus to the one with TabIndex =1?
Such a control may not exist, or may be disabled, invisible, have tabstop=.f., coordinates off viewport, return a .f. from .when()...
I think I tried to do that once, and had to account for all those possibilities, and take the reference to any available candidate with the lowest taborder, or none (had such cases too).