ContainerControl - Hiding methods/properties?

In the past I avoided using containerControls in case I ever wanted to distribute a control subclass as all RB editions did not support them…

That has changed and I am now considering doing a significant upgrade to a control that I distribute that could benefit from the use of a ContainerControl…
But that does have some too downside .

The first one is of course that such a composite control can’t be subclassed by others… which is a big negative … but unless the new framework changes some very basic things about how ContainerControls are implemented that won’t change.

The second issue is that it seems to me that using a ContainerControl would make a very messy API as compared to a regular RectControl subclass… While that would be fine for personal use, I can see it being problematic if it is distributed.

In a RectControl subclass you usually want most the method and properties of the control and can just override methods as needed… properties are more problematic … But usually there are not a lot one needs to hide, and one can go into in the inspector behavior dialog andat least hide then in the IDE… (though they will still autocomplete). Not perfect by not too bad…And to be safe one could shadow the properties one does not want anybody to change to help ensure they do nothing problematic.

But when you use a ContainerControl to create a composite there are an awful of methods, events and properties that would not be relevant and could “break” functionality or hurt appearance if used in code.

Events you can “implement” with no code to hide but at the cost of at least a small performance hit.
Methods who’s name you want to use you can override… But those you don’t want to be visible will still be there (and will autocomplete) and so could be called potentially messing with functionality making hard to see bugs.
Same with properties which can’t be overridden … and if you want to use those property names shadowing then would be more likely to introduce bugs…

What can be done to mitigate this complexity, involves a lot of busy work outside of exposing the API You want, as well making code more complicated and far form perfect.

For non RectControl internal classes one can use composition to just expose the API you want… But AFAIK there is no way to do something like that for ContainerControls (or RectControls)

Am I missing something? Is there any way to do composition or to simply hide the things you don’t want exposed with ContainerControls? If not, should there be? Do we need a ContainerContainerControl that holds containerControls that has no API of it’s own except embed?

You can add the attribute “Hidden” to the methods and properties you don’t want to autocomplete and they will no longer do so. Does that answer your question?

Does not that only work for items you add to classes/subclasses yourself and NOT the original components of internal classes?

As far as I know it only work for things you add to classes/subclasses, if you want to hide original components I think you might be out of luck, but I can’t say for certain since I have never had to do that.