敬阿奇C程序设计教程第版.pptVIP

  • 3
  • 0
  • 约9.4千字
  • 约 29页
  • 2019-11-28 发布于广东
  • 举报
6.4.2 文本输出 【例6.7】设计WinForm应用程序绘制不同字体的字符串。 新建WinForm项目,在Form1的设计视图中将此窗体调整到适当的大小并将“Text”属性设为“绘制不同字体字符串”。添加Form1的Paint事件,其事件代码如下所示: private void Form1_Paint (object sender, EventArgs e) { FontFamily[] families = FontFamily.GetFamilies(e.Graphics); Font font; string familyString; float spacing = 0f; int top = families.Length 7 ? 7 : families.Length; for (int i = 0; i top; i++) { font = new Font(families[i], 16, FontStyle.Bold); familyString = families[i].Name + 字体形状。; e.Graphics.Dra

文档评论(0)

1亿VIP精品文档

相关文档