FontFamily.Name Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of this FontFamily.
public:
property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String
Property Value
A String that represents the name of this FontFamily.
Examples
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:
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET