Click here to Skip to main content
11,710,824 members (84,875 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# Windows font WinForm

Can we show/hide installed fonts in Windows OS using C# in Windows Forms
Is there any class through which we can access a font say "Arial" and hide/show it.

We can manually show/hide a font by right click on the font in the Windows fonts folder
Posted 5-Dec-12 19:24pm
John d. Bartels at 15-Dec-12 12:08pm
There is a "FontDialog" class that will show the installed fonts

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I don't know if I understand your question right.
If you just want to get the installed fonts, there is a class "InstalledFontCollection" derieved from "FontCollection"

string familyName;
string familyList = "";
FontFamily[] fontFamilies;
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
// Get the array of FontFamily objects.
fontFamilies = installedFontCollection.Families;
// The loop below creates a large string that is a comma-separated
// list of all font family names.

int count = fontFamilies.Length;
for (int j = 0; j < count; ++j)
    familyName = fontFamilies[j].Name;
    familyList = familyList + familyName;
    familyList = familyList + ",";

Hope this is what you wanted to know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 270
2 Peter Leow 134
3 Abhinav S 130
4 Richard MacCutchan 80
0 Abhinav S 60
1 Member 4653839 40
2 barneyman 35
3 Sergey Alexandrovich Kryukov 35
4 Member 11793820 35

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100