Scrollbar update

I have a custom control with a scrollbar,
the value and maximum of this scrollbar can change as the user interacts.
but the visual (thumb) doesn’t change until the user rolls the mouse over
and sometimes is shows “two” thumbs (one is obviously a ghost)

I have tried using invalidate but that doesn’t seem to do anything

Had to add a timer… to delay the update of the scrollbar by 1/10 second as the calculation happened inside a canvas paint event

Were you updating it from the Paint event? I would suggest trying to move as much of your logic to a separate function “updateLayout”, try to keep everything in the Paint event, painting only. This is something that Apple have been saying for years, but it’s only recently that problems are visible because of it.

Creating a paint loop really drags down display performance too, this is where one control updates another control in the Paint event, which in turn then updates the first control.