wpf - Measure Maximum Fontsize for a control -


lets have 5 textblocks on screen each same size.

i have 5 items display (of varying length)

  • 10
  • 100
  • 1111
  • 99
  • 9192

is there way wpf calculate largest fontsize usable textblocks text fit in it's respective textblock, fontsizes same?

use viewbox

        <viewbox>             <stackpanel>                 <textblock text="10"/>                 <textblock text="100"/>                 <textblock text="1111"/>             </stackpanel>         </viewbox> 

then inside viewbox scale fit size available viewbox, regardless of font size.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -