题目:简单的文本编辑器
要求:能够调整文本框中的字号大小和字体颜色、字体名称和字体样式的设置
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
{
int t=10;//定义全局变量,一改就改,防止后面覆盖
string s="华文行楷";
public Form1()//预加载的文件(必有)
{
InitializeComponent();
textBox1.Text = "黄鹤楼";
}
private void radioButton5_CheckedChanged_1(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Black;
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
textBox1.Font = new Font(textBox1.Font.FontFamily, 10, textBox1.Font.Style);
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
textBox1.Font = new Font(textBox1.Font.FontFamily, 15,