cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Adjusting position properties of a button the resizes automatically

Hi all,

I've created a red notification icon, a bit like what you'd have on a smartphone using a Button.  

Screenshot 2020-01-31 at 10.56.13.png

The number populates from counting rows of incomplete data in the table (therefore needing attention by the user).  This part works fine.

The width of the button should be variable and autoresizes to fit the number it displays by using:

45+Len(Button3.Text)

 

This works, but is causing me a bit of an issue...

When the number gets longer, the left edge of the button stays fixed in place, and the button gets bigger by expanding to the right.  When it does this, it overspills onto other content which I wish to avoid - (it's an extreme example to demonstrate the issue) but it looks like this:

Screenshot 2020-01-31 at 10.57.00.png

This (below is what I need), working the opposite way around, so that the right side of the red button stays in a fixed position and grows in size, but to the left.

Screenshot 2020-01-31 at 10.57.17.png

Any ideas how this might be achieved? 🙂

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@Anonymous 

Use Len(Button3.Text) to also set the X property of your icon. Formula could look like:

 

icon.X = currentXvalue - Len(Button3.Text) + someOtherValue (maybe 5?)

 

You would just need to play around to get it where you want

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

Use Len(Button3.Text) to also set the X property of your icon. Formula could look like:

 

icon.X = currentXvalue - Len(Button3.Text) + someOtherValue (maybe 5?)

 

You would just need to play around to get it where you want

Anonymous
Not applicable

Worked like a charm - thank you @Anonymous 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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