您当前的位置: 首页 >  c#

C#实现利用单选框实现更改文本的richTextBox字体、大小、加粗

发布时间:2021-04-20 15:18:15 ,浏览量:7

功能

C#实现利用单选框实现更改文本的richTextBox字体、大小、加粗

程序
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace 单选界面 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void richTextBox1_TextChanged(object sender, EventArgs e) { } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (jiazu.Checked) richTextBox1.Font = new Font(richTextBox1.Font, richTextBox1.Font.Style | FontStyle.Bold); else richTextBox1.Font = new Font(richTextBox1.Font, richTextBox1.Font.Style ^ FontStyle.Bold); } private void radioButton1_CheckedChanged(object sender, EventArgs e) { richTextBox1.Font = new Font("宋体", richTextBox1.Font.Size, richTextBox1.Font.Style); } private void radioButton4_CheckedChanged(object sender, EventArgs e) { richTextBox1.Font = new Font(richTextBox1.Font.FontFamily, 10, richTextBox1.Font.Style); } private void radioButton3_CheckedChanged(object sender, EventArgs e) { richTextBox1.Font = new Font(richTextBox1.Font.FontFamily, 16, richTextBox1.Font.Style); } private void radioButton2_CheckedChanged(object sender, EventArgs e) { richTextBox1.Font = new Font("楷体", richTextBox1.Font.Size, richTextBox1.Font.Style); } } } 
后续

如果想了解更多物联网、智能家居项目知识,可以关注我的程序设计专栏。 或者关注公众号。 在这里插入图片描述

编写不易,感谢支持。

关注
打赏
1688896170
查看更多评论

暂无认证

  • 7浏览

    0关注

    115984博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0562s