Share via


FontFamily.Name Özellik

Tanım

Bu FontFamilyöğesinin adını alır.

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

Özellik Değeri

String Bu FontFamilyöğesinin adını temsil eden bir .

Örnekler

Aşağıdaki kod örneği, sınıfının özelliğindeki FamiliesFontFamily tüm yazı tipi ailelerini gösterir. Bu örnek, Bir Windows Formu ile kullanılacak şekilde tasarlanmıştır. Bu örneği çalıştırmak için forma bir ListBox adlandırılmış listBox1 ekleyin ve formun PopulateListBoxWithFonts oluşturucusundan yöntemini çağırın.

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

Şunlara uygulanır