Export (0) Print
Expand All

FontFamily Class

Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.

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

'Declaration
Public NotInheritable Class FontFamily
	Inherits MarshalByRefObject
	Implements IDisposable
'Usage
Dim instance As FontFamily

public final class FontFamily extends MarshalByRefObject implements IDisposable
public final class FontFamily extends MarshalByRefObject implements IDisposable
Not applicable.

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 Sub PopulateListBoxWithFonts()
    listBox1.Width = 200
    listBox1.Location = New Point(40, 120)
    Dim oneFontFamily As FontFamily
    For Each oneFontFamily In FontFamily.Families
        listBox1.Items.Add(oneFontFamily.Name)
    Next
End Sub

private void PopulateListBoxWithFonts()
{
    listBox1.set_Width(200);
    listBox1.set_Location(new Point(40, 120));

    //foreach (FontFamily oneFontFamily in FontFamily.Families)
    for (int iCtr = 0; iCtr < FontFamily.get_Families().length; iCtr++) {
        FontFamily oneFontFamily = FontFamily.get_Families()[iCtr];
        listBox1.get_Items().Add(oneFontFamily.get_Name());
    }
} //PopulateListBoxWithFonts

System.Object
   System.MarshalByRefObject
    System.Drawing.FontFamily

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft