Transparent labels aren't transparent over Listboxes or non-default Window backgrounds

Hi folks,

I’ve just noticed that placing a Label over a Listbox or a Window with a non-default background doesn’t honor the Transparent setting on Windows.

This worked properly in 2017r3 (the version I use to compile for Windows previously).

Anyone else? I couldn’t find an existing Feedback report.

Feedback search failure - I found Manfred’s <> and added to it.

Transparency on Windows is based on the control’s Parent. If it doesn’t have the right parental association, it does not emulate transparency on Windows as you might expect.

Unless the “parent” indicator is also broken, the labels are both children of the Listbox in my example.

There was something very bad about the way xojo draw on windows. During 2018 there was LOTS of changes, this is one of them. It is very common that xojo breaks some things beetwen releases, so, if you are going to move to another release, it is better to look at ALL of the release notes to see the changes.

In 2017r3 labes where custom controls, now they are native ones in windows, also they changed the way transparency works

At least in 2019r1, it is working, the pseudotransparency uses the background of the parent object, maybe you need to recreate the controls again, and be shure that the list is indeed the parent of the labels.

In here, the top list is NOT the parent of the labels. But in the bottom, the list IS the parent of the labels.
Note that this is called pseudotransparency because the label just change the background color to white(same as the parent), but is not really transparent.

My specific case is with regard to placing a Label onto a Listbox with a custom back color drawn in the CellBackgroundPaint event. In that case, the Label is NOT transparent, because it’s not looking at the resulting color assigned to the cells.

As a workaround you can maybe use a Canvas instead of a Label?

Same problem - the issue seems to be that the use of a custom cell background color is the issue.

Layer of controls is always going to be an issue and is generally to be avoided.

In you case maybe a canvas would work. Call a Method from the Listbox.CellBackground event so that it can be used by the ListBox and the Canvas might work.

Using a canvas, you can set the back color to the same as the custom cell background color, effectively making it appear transparent.

To all the Canvas advocates +1 since that is the temporary work around.

I’ll not mark it as answered, though, since it’s truly an inconsistency in Xojo’s Windows drawing functionality.