Xojo does not fire HeaderXPaint

I have a problem with HeaderBackgroundPaint and HeaderContentPaint: on Mac everything is fine, on Windows the program does not go into it.
If we resize the listbox it happens that it ends up going inside.
And from the moment he drew once, it’s good afterwards, he goes well in when he needs to.
I tried to add a Refresh or an Invalidate, without success …
I tried to return true or false to these events but since it doesn’t go through it, it doesn’t change anything.
Xojo 2020r21, Windows 10

Works fine for me here, they fire when the window opens. Can you upload a quick simple demo of it not working as my demo might be different to yours?

With a demo, it works fine for me too …
It’s in my big program that it doesn’t work …
The list is in a ControlContainer, and there is 2 or 3 ControlContainer of this type on the window : none display titles

Copy the root container and paste it into a new project then delete all code and see if it works with just the settings you have set on the containers and listbox at design time.

If it works then its something in your code, if it doesn’t work then upload the demo project.

As a side test, when you say it doesn’t fire until you resize it, does it fire if you just hover over it with the mouse before you resize it?

Just checking for my own sanity, you aren’t doing something like manually placing the header on there in code at open and it is actually the same header you see on open as after resize?

I never get the header displayed with a simple hover.

And in the Open I set HeaderHeight, that’s all.

I will try to separate the container from the rest, but not easy, it is linked to a database and there is a lot of work

Just copy it out, delete all the events/methods and manually add a few rows in the ide using the pencil/initial value, nothing fancy, I just want to see if a setting on the control is causing the issue first.

I may have removed too much code, but it works :frowning:

hehe, ok so you know its not a setting that’s causing the issue, now you start commenting out code until you find the problem :slight_smile:

hmmm

I missed that one, does the header even draw when the window opens?

If not, do you have any declares in your project that are altering drawing e.g. LockWindowUpdate or SendMessage with WM_SETREDRAW ?

no and no.

Cool, nothing magical happening then :wink:

Are you able to make a little video showing the issue, it might shed some light on it at this end?

If not, would it be easier to skype/zoom/discord (no cam) and walk me though the problem? Send me a PM if you want to try this.

1 Like

Nice to speak to you Marc, I’m glad we got it fixed, it wasn’t easy as I didn’t even realise you were using Karen’s listbox control.

I’m not sure it will be easy to replicate that issue to put a ticket in about it. I can only assume its either a race condition, recursion protection stopping the header painting or the order that the listbox is being manually initialised.

It seems to work fine if thelist.HasHeader is set in the framework, not in the code

A very big thank you to Julian for his availability!

Marc