[quote=496085:@Beatrix Willius]I need to assign a background color to the container control where is says “Plan 2” because I have a visibility problem with the controls below when scrolling. According to the docs Color.FillColor should do the trick. But at least on macOS BS the color is a bit darker. What is the correct color?
[/quote]
It could be that the background colour can no longer be represented by integers.
You might be able to do this by using NSVisualEffectMBS. Here is some code that I use to switch off the translucent effect in modal dialogs on Big Sur. You might be able to use parts of this to do what you want.
[code]#If TargetMacOS Then
Const kNSVisualEffectViewMaterialWindowBackground = 12
Dim nsWindowObj As NSWindowMBS
Dim appearanceObj As NSAppearanceMBS
Dim nsVisualEffectViewObj As NSVisualEffectViewMBS
Dim caLayerObj As CALayerMBS
nsWindowObj = Self.NSWindowMBS
'set the window appearance to aqua so that the controls look the same as non modal windows (especially important for edit field backgrounds)
appearanceObj = NSAppearanceMBS.appearanceNamed(NSAppearanceMBS.NSAppearanceNameAqua)
If appearanceObj <> Nil Then
NSAppearanceMBS.setAppearance(Self, appearanceObj)
End If
'set the background colour
If Self.HasBackColor = False Then
'we don’t have a custom background colour
'set the window background to look the same as a non modal window
nsVisualEffectViewObj = New NSVisualEffectViewMBS(0, 0, Self.Width, Self.Height)
nsVisualEffectViewObj.autoresizesSubviews = true
nsVisualEffectViewObj.material = kNSVisualEffectViewMaterialWindowBackground
nsVisualEffectViewObj.autoresizingMask = NSViewMBS.NSViewWidthSizable + NSViewMBS.NSViewHeightSizable
nsWindowObj.contentView.addSubview(nsVisualEffectViewObj, -1, nil)
Else
'we do have a custom background colour
'set the background colour by creating a core animation layer with our background colour
nsWindowObj.contentView.wantsLayer = True
caLayerObj = nsWindowObj.contentView.layer
If caLayerObj <> Nil Then
caLayerObj.backgroundColor = CGColorMBS.CreateDeviceRGB(Self.BackColor.Red / 255, Self.BackColor.Green / 255, Self.BackColor.Blue / 255, 1.0)
End If
End If
#Endif[/code]