Hi,
to convert a type of String to a type of FontWeight there's a class called
FontWeightConverter.
Here's the code for your example:
string sWeight = "Bold";
FontWeight fw = (FontWeight)new
FontWeightConverter().ConvertFromString(sWeight);
I hope it helps.
Regards,
Denis
"moondaddy" <mo*******@newsgroup.nospamschrieb im Newsbeitrag
news:Of**************@TK2MSFTNGP03.phx.gbl...
Sorry, I got tottaly messed up on the sample code in the first post.
it should be:
Suto code:
string sWeight = "Bold";
FontWeight fw = (FontWeight)sWeight;
Thanks.
"moondaddy" <mo*******@newsgroup.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>How can I convert a string to a FontFamily?
Suto code:
String sFont = "Bold";
FontFamily ff = (FontFamily)sFont;
Thanks.
--
mo*******@newsgroup.nospam