Compartir a través de

FontFamily.Families Property


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

 static property cli::array <System::Drawing::FontFamily ^> ^ Families { cli::array <System::Drawing::FontFamily ^> ^ get(); };
public static System.Drawing.FontFamily[] Families { get; }
static member Families : System.Drawing.FontFamily[]
Public Shared ReadOnly Property Families As FontFamily()

Property Value

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.

   void PopulateListBoxWithFonts()
      listBox1->Width = 200;
      listBox1->Location = Point(40,120);
      System::Collections::IEnumerator^ myEnum = FontFamily::Families->GetEnumerator();
      while ( myEnum->MoveNext() )
         FontFamily^ oneFontFamily = safe_cast<FontFamily^>(myEnum->Current);
         listBox1->Items->Add( oneFontFamily->Name );
private void PopulateListBoxWithFonts()
    listBox1.Width = 200;
    listBox1.Location = new Point(40, 120);
    foreach ( FontFamily oneFontFamily in FontFamily.Families )
Private Sub PopulateListBoxWithFonts()
    listBox1.Width = 200
    listBox1.Location = New Point(40, 120)
    Dim oneFontFamily As FontFamily
    For Each oneFontFamily In FontFamily.Families
End Sub

Applies to