---
title: "How to get all font styles from system in c#.net?"  
description: "How to get all font styles from system in c#.net?"  
author: "Anonymous User"  
published: 2011-08-24  
updated: 2011-09-29  
canonical: https://www.mindstick.com/forum/292/how-to-get-all-font-styles-from-system-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to get all font styles from system in c#.net?

I am implementing a Font [Dialog Box](https://www.mindstick.com/forum/34699/create-alert-dialog-box-in-android) application.\
I have created 3 list boxes for [font family](https://www.mindstick.com/forum/158669/how-can-change-the-font-family-of-a-text-using-css),font style & [font size](https://www.mindstick.com/forum/158654/what-is-the-css-property-used-to-specify-the-font-size-of-an-element) & a text box to display the [formatted text](https://answers.mindstick.com/qa/95106/what-is-the-best-way-to-convert-a-pdf-to-nicely-formatted-text).\
I have done the [coding](https://www.mindstick.com/articles/12290/teaching-coding-from-the-metal-up-or-from-the-glass-back) to get all the font families & to [apply them](https://answers.mindstick.com/qa/111776/what-are-the-principles-of-test-driven-development-tdd-and-how-do-i-apply-them) in the text box in the following code:\
\
[private](https://www.mindstick.com/blog/11097/java-access-modifiers-the-public-and-the-private-modifiers) void listBox1_SelectedIndexChanged(object sender, EventArgs e)\
{\
Font f = new Font(listBox1.SelectedItem.ToString(),24);\
textBox1.Font = f;\
}\
\
private void Form1_Load(object sender, EventArgs e)\
{\
InstalledFontCollection ifc = new InstalledFontCollection();\
[IEnumerator](https://www.mindstick.com/articles/1091/ienumerable-ienumerator-icollection-and-ilist-in-c-sharp) ie;\
ie = ifc.Families.GetEnumerator();\
while (ie.MoveNext())\
{\
listBox1.Items.Add(ie.Current.ToString().Substring(18).TrimEnd(']'));\
}\
\
But I am not able to get the [system font](https://www.mindstick.com/forum/160476/how-to-change-my-system-font-visual-studio-2022) styles & font sizes to the listbox1 & listbox2\
please help me.\
Thanks.

## Replies

### Reply by Manoj Bhatt

Thanks James.

### Reply by James Smith

Hi awadhendra,\
You can write following line of code to get all system installed fonts.\

```
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Drawing.Text;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            InstalledFontCollection fonts = new InstalledFontCollection();            for (int i = 0; i < fonts.Families.Length; i++)            {                Console.WriteLine(fonts.Families[i].Name);            }        }    }}
```


---

Original Source: https://www.mindstick.com/forum/292/how-to-get-all-font-styles-from-system-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
