C#中String对象转换为Font对象的方法

[复制链接]
查看11 | 回复2 | 2011-2-26 09:08:57 | 显示全部楼层 |阅读模式
FontConverter fc = new FontConverter();
//转换为文本形式
string strf= fc.ConvertToInvariantString(button1.Font);
Console.WriteLine("字符形式的Font:" + strf);
//从文本到字体
Font f = (Font)fc.ConvertFromString(strf);
button2.Font = f;...
回复

使用道具 举报

千问 | 2011-2-26 09:08:57 | 显示全部楼层
string str =Font.ToString() 返回表示当前 Object 的 String。Font fr = (Font)str...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行