When creating controls in the IDE, you can set the “layer” position of controls with these buttons below:
If I create a control dynamically in code, how can I do this? I’ve not been able to find a property that determines the layering order of controls. I have an instance where I have a canvas control where sometimes I want to make the canvas completely transparent and bring up an HTML Viewer behind it. I want the HTML Viewer to be behind the canvas as there’s a number of custom mouse related commands that the canvas has that can’t be implemented on the HTML viewer.
Please tell me this is not something I can only do in the IDE…
Actually, I can add/remove it at will utilizing control sets.
The issue I have is that when I want to show the HTML viewer, it’s showing an MJPEG stream. Just hiding that control will continue to consumer bandwidth as the MJPEG stream isn’t stopped. So I figured I would just create and close the control as needed. But I need it to remain BEHIND the canvas.
And obviously there is a property setting somewhere that sets the Z order. But it appears Xojo doesn’t allow that property to be set at run time - only in the IDE.
Can’t you use the parent property of the control? Assuming the canvas is the same size as the HTMLviewer, just use Canvas1.Parent = HTMLViewer1 which will change the z-order of the controls.