FontFamily.Name 속성

정의

FontFamily의 이름을 가져옵니다.

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

속성 값

String의 이름을 나타내는 FontFamily입니다.

예제

다음 코드 예제에서는 클래스의 속성에 있는 Families 모든 글꼴 패밀리를 보여 줍니다 FontFamily . 이 예제는 Windows Form과 함께 사용하도록 설계되었습니다. 이 예제를 실행하려면 라는 listBox1ListBox 폼에 추가하고 폼의 생성자에서 메서드를 호출 PopulateListBoxWithFonts 합니다.

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

적용 대상