web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamically changing f...
Power Apps
Unanswered

Dynamically changing font size in label

(0) ShareShare
ReportReport
Posted on by 6

I have an app that takes announcements form a sharepoint list puts the e most recent in gallery and then displays the the body content in a HTML text field.

the app will be displayed on a 65" 4k TV and i wanted be able to change the font size based on how big the announcement is.

 

what i have been trying is an if statement the checks the height of the HTML text field then makes the font size smaller if it is over a certain height. Here is the code:   If(HtmlTextAnnouncements.Height >= 500 ,10,15)

 

This does work to an extent but under certain circumstances when the font size gets smaller the html text field gets smaller, drops below the 500px threshold and then changes back to the larger font size causing a never ending loop changing between font sizes.

 

Any suggestions how to get around this?

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hello,

     

    Clarifying question. On the screen when it gets larger, the screen that is, what is causing the Textbox / Label to grow (is it just sizing based on the screen?). I ask because if you were to specifically have code in the Size property of that control to ensure that it was properly sized based on its Parent (the screen or container) then its possible it would no longer shrink weirdly on your or at least it would recover quickly.

     

    Also, I would say that instead of simply checking the height of the announcement, check the size of the Parent app/container/screen resolution so that you aren't accidentally picking the wrong one so it would be something like

     

    If(HTMLTextStuff.Height >= 500 || Parent.Height >= insert something that makes sense, 10, 15)

     

    This way you don't get caught simply checking one and it causing this issue. That plus the resize code... would be what I would do.
    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard