I'm attempting to update the font dialog box and I'm successful except for updating the style. I'm using a type converter to convert a string to a font object. Here is the code:
dlgFont.Font = (Font)TypeDescriptor.GetConverter(typeof(Font)).ConvertFromString("Arial, 48 pt");
This works. When the font dialog box shows it shows with Arial 48 pt. But if I use:
dlgFont.Font = (Font)TypeDescriptor.GetConverter(typeof(Font)).ConvertFromString("Arial, 48 pt, Bold");
the thrown exception tells that it can't parse the string and shows me the syntax which says to add [, Style] but nothing I tried for style works.
An additional challenge is finding a format that will accept the bitwise OR so I can combine Bold and Italic.
Any suggestions on this or another approach to updating the font dialog box?
Kyle
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).