RectControl and descendants background color

Is there a way to either specify the background color on tab or page panels? Either the color or specify transparency.

Mac OS X Mavericks.

There is a xippet to set the background of a text area transparent. Maybe this could be a starting point https://www.boxedbyte.com/xippet_view.php?xippet_id=190

[quote=116165:@william plunkett]Is there a way to either specify the background color on tab or page panels? Either the color or specify transparency.

Mac OS X Mavericks.[/quote]

Tab panels are transparent, although imposing a shade. I found no way to make them opaque. But you can emulate a non transparent color tab panel by coupling a rounded corner rectangle with a Segmented Control. Use the technique below to create a reusable one.

For the page panel, I do not know how to make it transparent and would instead use a series of Container Controls to have transparent pages, but here is how to proceed to make the background colored :

  • Drag a Container Control to the left of IDE (NOT on a window)
  • Drag a Page Panel onto that Container Control. Make it the same size, and lock all sides of the control
  • On each page of the PagePanel, place a rectangle of the same size which color you select in the IDE. Make all sides of the rectangle locked
  • Drag the ContainerControl over the window, make it the size you want.

To address the PagePanel.value, use

ContainerControlNameOnTheWindow.PagePanel1.Value

I don’t know how to color them either, but because they are transparent you can put them inside a Canvas which first draws what you want.

For a PagePanel this is easy because there is no border decoration, for TabPanel you’ll have to try and match the top inset and rounding, which might change by OS version, etc…

//Canvas' Paint with a TabPanel set just inside Sub Paint(g As Graphics, areas() As REALbasic.Rect) g.ForeColor = &cCCFFCC g.FillRoundRect 0, 18, g.Width, g.Height-18, 12, 12 End Sub

What a mission - but it works - thanks Michel.

You’re welcome, Peter :slight_smile: