How to know when a Container Control loses focus?

It is not what i should expect!! Imagine, three controls in a containercontrol each with own lost focus events and so on, but depending on the status of the other controls. Something like a containercontrol with a date control, a textfield for the week and a combobox of the year, on each change of control data you want to update the other two, but only when everything is correct to save it to … a database, array dictionary only one time, this reduce al lot of redundant coding.
And to avoid a lot of extra communication you want to have ONE lost focus to save the data and thus fire the lost focus of the containercontrol when you leave the last control…
At this time (version XOJO2016R4.1) the containercontrol looses a lot of it’s functionality!
And why is there an lostfocus event available… if it won’t work at all.

AFAIK containerControl is not focusable. Controls on it are.

Yes, i know that now, but why is there an event called lost focus if it don’t work at all. It should not be working as bag of controles without any encapsulated events.

ContainerControl is technically an embedded window. So it has the same events, but given the embedded nature, they are inactive. Resizing and Resized are another example.

Good programming IMHO is the ability to overcome limitations (call it workaround). Once you know what you want to obtain, it is usually fairly easy to find a way.

Of course, i did found a way work to around it, but don’t sell a car with 7 gears if the gearbox has only 5 gears, meaning just get rit of the lost focus / got focus events if it don’t work.

Sigh.

Window embedded cannot get focus because it cannot get in front. They are not selling you events, the events simply cannot fire because of the way a containerControl is built.

Good programming is also being able to accept reality as it is.

A ContainerControl can get focus, if you set the AcceptFocus property to True. I don’t know if that will help in this case or not, though.

You are right. No focus ring, even if it has focus, though. But the gotfocus and lostfocus events do fire. Thanks.