# Webpage.Resized dont change container.width

**URL:** <https://forum.xojo.com/t/webpage-resized-dont-change-container-width/31619>\
**Category:** Web\
**Created:** [May 25, 2016, 12:28pm UTC](https://forum.xojo.com/t/webpage-resized-dont-change-container-width/31619 "2016-05-25T12:28:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krystof\_Jurecka](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/5e9695/32.png) [@Krystof\_Jurecka](https://forum.xojo.com/u/Krystof_Jurecka)\
**Post date:** [May 25, 2016, 12:28pm UTC](https://forum.xojo.com/t/webpage-resized-dont-change-container-width/31619/1 "2016-05-25T12:28:12Z")

</div>

Hello. It’s an example, but I need this. Webpage.resized event doesn’t want to change container.width. Do you know why? The code below doesn’t work. When I used this code then I resized webpage and container has alwas the same width…

Through button.action event this works fine, but through webpage.resized event not. I tried too Timer and Thread in resized event and nothing help.

In webpage1.resized:

```auto
Container1.width = self.width -500
```

in button.action(that works):

```auto
Container1.width = webpage1.width+100
```

---

<div class="post-metadata">

**Author:** ![Krystof\_Jurecka](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/5e9695/32.png) [@Krystof\_Jurecka](https://forum.xojo.com/u/Krystof_Jurecka)\
**Post date:** [May 26, 2016, 7:53am UTC](https://forum.xojo.com/t/webpage-resized-dont-change-container-width/31619/2 "2016-05-26T07:53:53Z")

</div>

I found the answer. I can’t use container.width = webpage.width, but container.width = container.width + difference. Very easy: “page new width” - “page old width” = difference.

In Webpage.resized:

```auto
  if FirstResized = false then
    oldPGwidth = pgDCP.Width
    actualPGwidth=pgDCP.Width
    GanttCont1.Width = actualPGwidth-120
    FirstResized = true
  else
    actualPGwidth=pgDCP.Width
    GanttResized(actualPGwidth - oldPGwidth)
  end if
```

In GanttResized:

```auto
ganttcont1.Width= GanttCont1.Width+difference
  oldPGwidth = oldPGwidth+difference
```

---

<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:20pm UTC](https://forum.xojo.com/t/webpage-resized-dont-change-container-width/31619/3 "2020-10-29T18:20:08Z")

</div>


