cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Center Labels Dynamically

Hello everyone,

 

I'm working on a fun little raffle app for the holidays. The length of the names of the winners are going to vary so my Width property formula for the Becky Bloom label is 22*Len(Label1.Text). I think 22 characters will be enough to accommodate our longest names. I set the X property of the Becky label to lblCongratulations.X, but as you can see it is left aligning. The Alignment property of the Becky label is Center. How do I get the Becky label to center dynamically under the Congratulations label? I wasn't able to find the solution in Community posts so any help you can give me would be appreciated. Also, if there is a chance that the Congratulations label could shift around as long/short names from the flow populate the name label, can you advise how to keep everything centered under the Holiday Party Raffle label? Thank you- Teresa

 

LabelSS.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

HI Teresa

Why not set the width of the Becky label equal to the width of the congratulations label? So long as the alignment property of both labels are set to centre, they should both be equally centre aligned.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

HI Teresa

Why not set the width of the Becky label equal to the width of the congratulations label? So long as the alignment property of both labels are set to centre, they should both be equally centre aligned.

View solution in original post

Highlighted

That's a great idea-thanks! The Congratulations label should be wide enough to accommodate even the longest full name of an employee. I entered the following formula into the Width property of the Becky label:

 

lblCongratulations.Width

 

Have a great day!

Teresa

Highlighted
Super User III
Super User III

Glad that solved your problem - hope you have a great day too!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,083)