# Canvas aligned to a window

**URL:** <https://forum.xojo.com/t/canvas-aligned-to-a-window/11477>\
**Category:** General\
**Created:** [October 7, 2013, 4:05pm UTC](https://forum.xojo.com/t/canvas-aligned-to-a-window/11477 "2013-10-07T16:05:12Z")\
**Posts on this page:** 3\
**Page:** 1

<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 7, 2013, 4:05pm UTC](https://forum.xojo.com/t/canvas-aligned-to-a-window/11477/1 "2013-10-07T16:05:12Z")

</div>

Can someone give me an advise on this:

I have a canvas that should always align to the right edge of a window.  
If the window is resized smaller or wider then the canvas should still be visible at the right edge.

It would be even better if this is possible with 2 canvases, one canvas aligned to the right and one always in the center of the window.

I’ve also tried this with a container control, but no luck.

Any help is highly appreciated.

Thank you.  
Andre.

---

<div class="post-metadata">

**Author:** ![Roger\_Clary](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@Roger\_Clary](https://forum.xojo.com/u/Roger_Clary)\
**Post date:** [October 7, 2013, 4:50pm UTC](https://forum.xojo.com/t/canvas-aligned-to-a-window/11477/2 "2013-10-07T16:50:00Z")

</div>

Use the lockright property of the canvas.  
For the centered on, you will need to calculate its coordinates in the resized event of your screen.

---

<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, 4:53pm UTC](https://forum.xojo.com/t/canvas-aligned-to-a-window/11477/3 "2020-10-29T16:53:14Z")

</div>


