Opaque Container Control

Is there any way to have a properly opaque container on Windows? Controls underneath have a habit of bleeding through the container regardless of the containers visibility setting.

This is for custom controls like an on-demand calendar which may overlap existing controls. Hiding the existing controls makes the UI look odd.

My only current workaround is to use a borderless window instead which has it’s own issues.

[quote=251792:@Stephen Dodd]Is there any way to have a properly opaque container on Windows? Controls underneath have a habit of bleeding through the container regardless of the containers visibility setting.

This is for custom controls like an on-demand calendar which may overlap existing controls. Hiding the existing controls makes the UI look odd.

My only current workaround is to use a borderless window instead which has it’s own issues.[/quote]

I tried quantities of workarounds. The only way I found is what you did : use a window.

What about a canvas as the bottom most object inside the container?
That would allow you to color it too :slight_smile:

[quote=251914:@Tim Parnell]What about a canvas as the bottom most object inside the container?
That would allow you to color it too :)[/quote]

Problem is under Windows there are controls that pop through whatever is on top. For instance TextField shows through anything when the mouse passes over. So if you have a TextField under the ContainerControl, canvas or not, it will show up on top. Same thing for the ScrollBar of a ListBox.

I filed a bug report about the TextField, but was told that is normal behavior for the control.

For TextField, the solution is to either disable it, or to make its super TextArea.

For the vertical scrollbar of a ListBox, it needs to be hidden, otherwise even when the listbox is disabled, it still bleeds through.

Would the canvas be able to intercept mouse events somehow?
Just spitting out ideas, I haven’t tried anything.

[quote=251927:@Tim Parnell]Would the canvas be able to intercept mouse events somehow?
Just spitting out ideas, I haven’t tried anything.[/quote]

Believe me, I tried every trick I know of. Unlike for MouseDown, a canvas cannot intercept MouseMove as one cannot return True. I tried manipulating the Z-Order, but still that pesky TextField goes through. The cursor even shows through anything on top. Messy…

The only solution is to use a window.