Class based on Canvas with embedded controls

I created a custom control using a Container control.
I have spent days trying to make it visible in Windows Xojo 2018
It works fine in Xojo 2015, and on Macs
Ive disabled GDI, tried composite, disabled literally every line of code in events.

So I would like to know if I can do the same kind of thing by subclassing a canvas?
Its a toolbar substitute… Im looking to clone a button class , but I cant find a way to embed such a button in a class derived from Canvas, as it has no visible design page in the IDE.
Is this a non-starter?

Pretty much, unless you put your buttons in a Container so you can use EmbedWithin. You can reparent controls at runtime that are provided as variables, but that’s not a great route to go with this, either. The Container method you describe first would be the best path unless you use a Canvas and draw everything yourself and only re-parent controls as needed to do things like embed a TextField.

In the end, I have a control as a child of the window, and index (0) of a control set
I have a class that clones this and places them on the window.
It has a Paint() method, which I call during the Window’s Paint() event, passing the graphics.

So I now have a workaround which produces results indistinguishable from the original custom control.
Its just hard to understand or explain why a custom control using a container parent would fail to display.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.