Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font style and font weight programmatically using c# in metro app for windows 8.1

Tags:

c#

xaml

I want to change FontStyle and FontWeight using c# in my code .

I tried this:

textblock.FontStyle =FontStyle.Normal 

and

textblock.FontWeight =FontWeight.Bold 

but its not working.

like image 962
user3090763 Avatar asked May 21 '14 08:05

user3090763


1 Answers

I'd not recommend to do that in code, but if it is necessary:

textblock.FontStyle = Windows.UI.Text.FontStyle.Italic;
textblock.FontWeight = Windows.UI.Text.FontWeights.Bold;
like image 169
Ptr Avatar answered Sep 30 '22 07:09

Ptr