用可用字体列表填充 ComboBox [英] Fill ComboBox with List of available Fonts

查看:18
本文介绍了用可用字体列表填充 ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用系统中所有可用字体的列表填充组合框?

How can I fill a combo-box with a list of all the available fonts in the system?

推荐答案

您可以使用 System.Drawing.FontFamily.Families 来获取可用的字体.

You can use System.Drawing.FontFamily.Families to get the available fonts.

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

这篇关于用可用字体列表填充 ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆