# Suppress a window/control update

**URL:** <https://forum.xojo.com/t/suppress-a-window-control-update/31144>\
**Category:** General\
**Created:** [April 28, 2016, 7:06pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144 "2016-04-28T19:06:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dale\_Arends](https://forum.xojo.com/user_avatar/forum.xojo.com/dale_arends/32/442_2.png) [@Dale\_Arends](https://forum.xojo.com/u/Dale_Arends)\
**Post date:** [April 28, 2016, 7:06pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/1 "2016-04-28T19:06:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [April 28, 2016, 7:20pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/2 "2016-04-28T19:20:24Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [April 28, 2016, 7:57pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/3 "2016-04-28T19:57:45Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [April 29, 2016, 1:02am UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/4 "2016-04-29T01:02:56Z")

</div>

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?

```auto
#pragma disableBackgroundTasks
```

---

<div class="post-metadata">

**Author:** ![Dale\_Arends](https://forum.xojo.com/user_avatar/forum.xojo.com/dale_arends/32/442_2.png) [@Dale\_Arends](https://forum.xojo.com/u/Dale_Arends)\
**Post date:** [April 29, 2016, 7:40pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/5 "2016-04-29T19:40:56Z")

</div>

[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?

```auto
#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.

---

<div class="post-metadata">

**Author:** ![Dale\_Arends](https://forum.xojo.com/user_avatar/forum.xojo.com/dale_arends/32/442_2.png) [@Dale\_Arends](https://forum.xojo.com/u/Dale_Arends)\
**Post date:** [April 29, 2016, 7:49pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/6 "2016-04-29T19:49:55Z")

</div>

[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.

> [@](#):
>
> For Windows WFS has freezeupdate & unfreezeupdate (may need updating for 64 bit)

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [April 29, 2016, 8:16pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/7 "2016-04-29T20:16:38Z")

</div>

Sometimes I should simply abstain…

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [April 30, 2016, 3:45am UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/8 "2016-04-30T03:45:56Z")

</div>

sometimes people wont use your answer  
its a fact of life

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [April 30, 2016, 7:05am UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/9 "2016-04-30T07:05:52Z")

</div>

No problem with that.

But ignoring completely is unpleasant ☹

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [April 30, 2016, 2:36pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/10 "2016-04-30T14:36:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:17pm UTC](https://forum.xojo.com/t/suppress-a-window-control-update/31144/11 "2020-10-29T18:17:47Z")

</div>


