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)
Components added to TcxTabSheet are not displayed at runtime when TcxPageControl is hosted in a TFrame
Answers approved by DevExpress Support
Hello James,
This is a limitation of the VCL Frames technology. It is prohibited to place additional controls on a Frame instance. If you try the same approach with the standard TPageControl control, it will not even let you create additional tabs. Moreover, if you try to place a button on your frame that is placed on the Form5 form, the IDE will not let you do so - the button will be placed on the Form5 form instead. As a solution, you can create a descendant of your TAthenaOptionsFrame frame (File->New->Other…->DelphiProjects->Inheritable Items), place required controls there, and use this new frame class on your form. Please let me know if you need any help with this solution.
Hi Paulo,
Thanks for the update - I did see that the TPageControl prohibits this behaviour but then I noticed I could with a TcxPageControl (perhaps the TcxPageControl should disable this behaviour also as it appears misleading?).
I will go with the inheritance approach in the meantime, thanks.