Export (0) Print
Expand All

FontFamily.Families Property

Returns an array that contains all the FontFamily objects associated with the current graphics context.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public static FontFamily[] Families { get; }

Property Value

Type: System.Drawing.FontFamily[]
An array of FontFamily objects associated with the current graphics context.

The following code example shows all the font families in the Families property of the FontFamily class. This example is designed to be used with a Windows Form. To run this example, add a ListBox named listBox1 to a form and call the PopulateListBoxWithFonts method from the form's constructor.

private void PopulateListBoxWithFonts()
{
    listBox1.Width = 200;
    listBox1.Location = new Point(40, 120);
    foreach ( FontFamily oneFontFamily in FontFamily.Families )
    {
        listBox1.Items.Add(oneFontFamily.Name);
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft