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

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

问题描述

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

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

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

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