Avatar of Dnx_7
Dnx_7
Flag for Belgium asked on

How to set FontWeights to any value (Bold, UltraBold, ...) from C# Reflection?

Hi experts,

I have a string that contains "Bold" or "UltraBold" or something else that represents a FontWeights (in string format).
I also have an object (Type) that reprensents the "FontWeights" of a WPF control (from textblock or textbox or else)
I don't know how to set the String value to a fontweight value from reflection in C#

Any helps will be grateful,


Thanks,

Kind Regards.
C#.NET Programming

Avatar of undefined
Last Comment
Dnx_7

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ioannis Paraskevopoulos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dnx_7

ASKER
Thanks!
Your help has saved me hundreds of hours of internet surfing.
fblack61