I have a button added to a Gallery control, and I want it to always be positioned to the right side of the gallery.
So, as shown below, I set the X property of the button control to a specific number, which positioned the button to appear on the right side of the gallery.

However, when I play the app and change the resolution, the button moves to the left, which is understandable since we provided a static X property.

To stick the button to the right of the Gallery/Containers, use the following formula:
X : Parent.Width - {current-control-id}.Width

You can even test the custom page on the Model-Driven App, and the button will always stick to the right.

🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment