delphidevexpresstframetpagecontrolttabsheet

Components added to TcxTabSheet are not displayed at runtime when TcxPageControl is hosted in a TFrame


I am building a re-usable TFrame which contains a TcxPageControl. The idea is the frame is dropped onto the form and then I can add pages specific to that form.

This works fine, I can successfully add pages through the designer and at runtime those tab pages appear. However, the problem is any components that are dropped onto the TcxTabSheet don't.

If I add a page on the Frame itself (i.e. the base Frame, not the one dropped onto the form) and drop components on that, those show. However, if I drop components onto that same page from the form they don't.

I am clearly missing something here but I would have thought the page control would just work as it would on any form (regardless if it's being surfaced from a TFrame) but clearly there seems to be something it doesn't like.

Is this a bug or am I just not doing it right?

Note - I am using the "Add to Palette" option to add the Frame as a component as I want to surface the TPageControl properties (incase that matters)


Solution

  • As it turns out this behaviour is actually a VCL limitation and not a limitation on the TcxPageControl component itself. The difference here was the TcxPageControl allows the ability to add pages from the Frame instance which is kind of misleading.

    A workaround is to simply inherit from the TFrame instance which contains the TcxPageControl (or even just a standard TPageControl) and add the pages in there. Not ideal as it means I am effectively creating a separate TFrame per page but at least it means I can re-use common code which was the goal.

    Clarification from DevExpress.