Zac*_*son 63
您可以使用System.Drawing.FontFamily.Families
获取可用字体.
List<string> fonts = new List<string>();
foreach (FontFamily font in System.Drawing.FontFamily.Families)
{
fonts.Add(font.Name);
}
// add the fonts to your ComboBox here
Run Code Online (Sandbox Code Playgroud)
不知道为什么我们需要在foreach
这里.
IList<string> fontNames = FontFamily.Families.Select(f => f.Name).ToList();
Run Code Online (Sandbox Code Playgroud)