>Greetings all...
>
>I noticed for the first time today that you can TAB out of a class... I have a simple class that pops up and gives users a couple of choices. TAB goes between the objects in the class, which in this case are two combo boxes, and a command button to make the class invisible, and to pass the focus to the next input field in the form.
>
>I had expected that TABing repeatedly would cycle thru the objects in the class, but it doesn't work that way. TABing the third time in the class takes the focus to an object in the form beneath the class.
>
>How do I get the class to retain the 'focus' until the command button it clicked?
>
>Many thanks!
Your command button code click could be like:
this.parent.Visible = .F.
keyboard '{TAB}'
and have this code in your container class' LostFocus code:
If this.Visible
NoDefault
this.firstControl.SetFocus()
endif
However, note that this wouldn't only allow TAB to cycle within the container class containers but would set focus to first control if the user say use mouse to get to another control on the form (IOW either keyboard or mouse container retains the focus).