使用FontDialog组件设置字体

Posted on 2018-12-26 22:33  努力成长静待花开  阅读(861)  评论(0编辑  收藏  举报

实现效果:

  

知识运用:

  FontDialog组件的Font属性    //获取或设置选定的字体

  public Font Font  { get;set; }

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            fontDialog1.ShowDialog();
                textBox1.Font=fontDialog1.Font;
        }