EmbedWithin not working inside ContainerControls?

I had some code that used EmbedWithin to insert a ContainerControl into a TabPanel that was part of a window. That worked.

Now I rewrote the code to insert a ContainerControl between the Window and the TabPanel, so that the TabPanel is now a part of the new ContainerControl, which I then place into the Window.

With that, when I switch between Tabs of the TabPanel, the embedded CCs do not get removed any more when I switch to another Tab. This mean that after clicking all the Tabs of the TabPanel, I see every control of every embedded CC in the window. That’s not right, of course.

Is this a known issue? Anyone know of a work-around?

Ah, nevermind - it works in a small test project, so I must be doing something wrong.

I found the cause:

If the ContainerControl in the Window has Transparency=False and HasBackColor=False then the background is not cleared (it’s initially black) and changing panels causes them to be drawn overlapping, as they’re never cleared.

This seems wrong to me - I’d expect this to happen when Transparency is True, not when it’s False.


And the funny thing is: When I created the test project in Real Studio 2012, I was not even offered the option to set the CC’s Transparency to True, and I would not see the problem in the running app then, either. And when I opened that project in Xojo 2018r2, it would then default Transparency to True, which also led to this working.