Suppress a window/control update

Is it possible to keep a window or control from updating when a property is changed?

I have a situation where I need to momentarily change the text size in a listbox but I don’t want the change to be seen on the screen before I restore the text size to the original size. Is it possible to suppress the redrawing of the control, or the window, until I reset the property?

Place an invisible canvas over the ListBox. When needed, make it visible and Drawinto that listbox in the paint event. Then as the ListBox is covered by the paint mockup, you can do whatever you want behind the curtain. When finished, make the canvas invisible and voila !

For OS X IF you do this all in one event (or methods called by the event), then you can change the size, do whatever and change it back & you’ll never see a change as it shouldn’t get a redraw in between (unless you do something to permit one)
There may be other means to lock updates as well

For Windows WFS has freezeupdate & unfreezeupdate (may need updating for 64 bit)

Have you tried hiding the listbox, performing your changes and then showing it again?

Does adding the following to the header of the method help?

#pragma disableBackgroundTasks

[quote=262928:@Sam Rowlands]Have you tried hiding the listbox, performing your changes and then showing it again?

Does adding the following to the header of the method help?

#pragma disableBackgroundTasks

I don’t want it hidden and restored since that will introduce UI effects. And the #pragma won’t work since it isn’t a background task.

[quote=262899:@Norman Palardy]For OS X IF you do this all in one event (or methods called by the event), then you can change the size, do whatever and change it back & you’ll never see a change as it shouldn’t get a redraw in between (unless you do something to permit one)
There may be other means to lock updates as well [/quote]

Actually there will, of necessity, be sufficient time that a redraw of the control will likely occur.

That is the answer! Since this will be a 32-bit app I’m not concerned with updating the routines.

Thanks for the lead, Norman.

Sometimes I should simply abstain…

sometimes people wont use your answer
its a fact of life

No problem with that.

But ignoring completely is unpleasant :frowning:

maybe they already tried what you suggested & it didn’t work ?
maybe they dont trust your advice ?
maybe they don’t see your replies because they have you ignored ?

who knows
no point pouting about why people don’t take your advice