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?
Kyle
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?
Kyle