I have a window with 3 controls all bevel buttons…
TWO of them I want to be on the top of the visual stack
the third one has multiple instances created at runtime based on what the app is doing…
but in some situations a new dynamic instance covers one of the other two controls
Is there a way to send a dynammic control “to back” when it is instatianted??
the two buttons that need to be displayed are a PREV and NEXT the are used to scroll the list of the dynamic controls left and right if required
but if the LAST item exceeds the width… I still want as much of it to display as it can
the two controls that need to stay on top are members of a second control set…
I have an idea to CLOSE the control and reinstantiate it after the other control set is situated.
I do not know if that will cause it to come to the top , or if it will retain its original z-order.
if that doesn’t work… I’ll encapuslate the controlset that changes inside another container or canvas (not exactly what I “want”, but if the first idea doesn’t work. perhaps that one will
Julian, there are no “unneeded controls”… every control that exists at any moment are “needed”…
It is a strip control with an arrow at each end, and a row of buttons in the middle
where the LAST of those buttons may need to be partially under the right side arrow
Adding an “inner” container should have worked, but it seems the “parent” kept disconnecting (or so it seemed)
yes it could have, but I opted for a Container Control and two controlsets of Bevel Buttons
this basically eliminated me having to deal with the “drawing” of the tabs, and just where they were positioned.
I’ve just had a play around with zorder in Windows, while I have had success changing the zorder of similar controls, it would seem Xojo renders the window in its own unique way (eg. it forces PushButtons to the front and not BevelButtons)
Indeed there are idiosyncrasies in Windows zorder. The worst one being that TextField get to front when the mouse hovers them.
But SetWindowPos does work.
On Mac seems there is no equivalent way to change zorder at run time. There is for apps, but I never saw anything for controls. Windows have orderFront and OrderBack, though.
Michel, see <https://xojo.com/issue/47001> and have a play around with attached project, the code in WindowsAPI.ZOrderFix should point you in the right direction. Try it on something small first, good luck.