Click here to Skip to main content
11,643,493 members (79,375 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 OriginalGriff 485
1 480
2 DamithSL 328
3 Sergey Alexandrovich Kryukov 270
4 CPallini 222
0 DamithSL 541
1 OriginalGriff 495
2 Mika Wendelius 469
3 Sergey Alexandrovich Kryukov 330
4 Afzaal Ahmad Zeeshan 324

Advertise | Privacy | Mobile
Web04 | 2.8.150731.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