c# richtextbox修改字体大小和颜色

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/update7/article/details/80298481
一开始:
this.richTextBox1.Text = "欢迎";
this.richTextBox1.SelectAll();
this.richTextBox1.SelectionColor = Color.Red;
Font font = new Font(FontFamily.GenericMonospace,14,FontStyle.Regular);
this.richTextBox1.SelectionFont = font;

点击按钮:
this.richTextBox1.Text = "谢谢";
this.richTextBox1.SelectAll();
this.richTextBox1.SelectionColor = Color.Black;
Font font = new Font(FontFamily.GenericMonospace,10,FontStyle.Regular);
this.richTextBox1.SelectionFont = font;
展开阅读全文

没有更多推荐了,返回首页