Background for DesktopTabPanel and DesktopGroupBox

I have a window containing a TabPanel (which fills the window). There are various tabs with various GroupBoxes on them. On Mac/Lin, the window background colour shows through, and the GroupBoxes appear to have their own off-white colour.

On WIndows, transparent seems not to work at all (at least, under W10), but unfortunately nethier the TabPanel nor the GroupBox appear to have any provision for a background colour. I suppose I could slip a canvas underneath the GroupBoxes on each tab and colour it, and slip a canvas under the controls in each GroupBox, but before embarking on any such hack is there a better approach?

I’m using the GroupBoxes since AIUI, they have the ability to make sets of radio buttons behave.

TabPanel on Windows is not transparent. Try this:
left TabPanel as it is but resize it vertically to the point it has only tabs visible. In newly restored empty place put PagePanel. In Change event of TabPanel put some code to switch between PagePanels accordingly and put everything on PagePanel as it was previously placed on TabPanel. PagePanel IS transparent on Windows.

1 Like

Ah, interesting idea, but - oh - that’ll be quite some work. Thanks for the point about PagePanel transparency on Windows.

Oh I see… but you can go lazy route - edit TabPanel’s Super from DesktopTabPanel to DesktopPagePanel and clean up the code on some events :wink: Then just put another real TabPanel over it and synchronise PagePanel switching with TabPanel Change. This way, keeping the old TabPanel name will allow you to leave most of the code unchanged.

That’s probably a better approach - thanks again.

Since 2018 or so, Xojo Windows relies on Direct2D, which does not support transparency. No control is actually transparent. It relies on pseudo transparency, where the “transparent” control takes the color of its parent.

One workaround for GroupBox would be to draw on the window graphics property.

For TabPanel, simply place a rectangle on it as background.