cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RvdHeijden
Post Patron
Post Patron

Centering a popup

How do I centre a pop-up in powerapps ?

 

In the Edit mode I can easily centre the pop up but when I engage the View mode it doesn't align right. 

It will probably be something with the X and Y and calculating the centre of the screen but I'm not sure

1 ACCEPTED SOLUTION

Accepted Solutions

@RvdHeijden ,

Those are correct - I just did one here with

X of (Parent.Width - Self.Width)/2

Y of (Parent.Height - Self.Height)/2

and it is certainly centered properly.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @RvdHeijden ,

Yes - it is pure mathematics (not coding).

For X, (screen height - popup height) / 2. 

For Y (screen width -pop-up width) / 2.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz then I think I'm doing something wrong because your solution sounds logical but it still doesn't align right. The formula I'm using is:

 

X=(Parent.Height-596)/2

Y=(Parent.Width-1125)/2

Now it aligns a little to the left and to the bottom

@RvdHeijden ,

Those are correct - I just did one here with

X of (Parent.Width - Self.Width)/2

Y of (Parent.Height - Self.Height)/2

and it is certainly centered properly.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz I found the problem and it was my mistake 🙂 . As you can see in my reply I've flipped the X and Y

X=Height and Y=Width but it should be X=Width and Y=Height

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,590)