
Announcements
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?
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