Group Box control shade backcolor in MacOS


I’m using a canvas control that is inside of a Group Box. The new Xojo MacOS Group Box uses shading now instead of lines…I need the canvas to be transparent which requires me to use FillRect ForeColor to be the same as the window BackColor so I can draw lines. The line Control has been depreciated for a while but it still is working in Windows in the 2023 Releases. Now the Canvas ForeColor has to match the Group Box shade BackColor. I don’t seem to be finding GroupBox.BackColor. My Question how do I find the GroupBox BackColor to make my Canvas Transparent? Trial & Error of 1000’s of Hex colors can take forever to find.

Dim Buffer As Picture

Canvas.Buffer.Graphic.ForeColor = Window.BackColor
Canvas.Buffer Graphics.FillRect(0, 0, Cavas.Width, Canvas.Height)

If your canvas is inside the groupbox, why not just not draw a background at all on macOS? You can do that by using

g.ClearRectangle 0, 0, g.width, g.height

PS: you’ll never “match” that color. macOS windows and controls are translucent and pick up the background color in subtle and not-so-subtle ways at times. Including just a plain old window.

1 Like