FontFamily.Families Propriedade

Definição

Retorna uma matriz que contém todos os objetos FontFamily associados ao contexto de gráficos atual.Returns an array that contains all the FontFamily objects associated with the current graphics context.

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

Valor da propriedade

FontFamily[]

Uma matriz de objetos FontFamily associados ao contexto de gráficos atual.An array of FontFamily objects associated with the current graphics context.

Exemplos

O exemplo de código a seguir mostra todas as famílias de fontes na Families propriedade da FontFamily classe.The following code example shows all the font families in the Families property of the FontFamily class. Este exemplo foi projetado para ser usado com um Windows Form.This example is designed to be used with a Windows Form. Para executar este exemplo, adicione um ListBox nome listBox1 a um formulário e chame o PopulateListBoxWithFonts método do construtor do formulário.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 = 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 )
    {
        listBox1.Items.Add(oneFontFamily.Name);
    }
}
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

Aplica-se a