Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size in XAML?

Tags:

c#

font-size

xaml

how can I increase font of a, let's say, TextBlock? I don't want to have something like this:

<TextBlock FontSize="20">
  text
</TextBlock>

because it won't work correctly when user changes Windows' settings of the controls' font size. Do we have something like +VALUE (eg. +2), similar to HTML?

EDIT
That's what I meant talking about the Windows' settings: enter image description here

but the answers I received totally satisfies me.

like image 427
SOReader Avatar asked Dec 01 '22 05:12

SOReader


1 Answers

WPF doesn't have the em font size, there alternatives in the answers to this SO

The simplist may be

<ScaleTransform ScaleX="1.2" ScaleY="1.2" /> 
like image 101
Bob Vale Avatar answered Dec 04 '22 06:12

Bob Vale