3
votes

I want to use a thin font weight in my win forms window. The only thing I've been able to find is FontStyle, but I can only choose from Bold, Italic, Regular, Strikeout and underline. No possibility to make my font thin. Preferably, I'd like to be able to specify the font weight (100, 200 etc).

3
I don't think you can access FontWeight in Windows Forms (it's available in WPF). Just use a thinner font such as Segoe UI Light as a workaround. - Jon
You do the exact same thing you do in Microsoft Word and all other Windows applications: you use a font that supports the weight you desire. But I strongly recommend against it. Use the default system font, the one that the user picked for their applications: SystemFonts.MessageBoxFont. It is the one that they prefer and find the most readable. - Cody Gray

3 Answers

2
votes

I've not tried it, but looking through CreateFont function I believe it can certainly be done via P/Invoking CreateFont function.

It takes a parameter fnWeight which is font weight. Then you could call Font.FromHFont method to get the instance of Font.

1
votes

You will have to include a font file of a thin weight font in your deployment.

Then you can use it within your app.

This will likely cost you licensing I'm afraid. Wpf does make it easier so might be a more viable option depending on how great the need and how great the budget.

1
votes

As far as I know, you can't do it directly.

That being said, you embed WPF controls in Windows Forms pretty easily, and WPF controls have font weight property exposed directly. Perhaps that might be suitable?