展开全部
简单的写了下,放大、缩小、变色、变字体的参数都是在程序中固定的,你可以改下,将参数输入进去,这样要好些。
private void button1_Click(object sender, EventArgs e) //放大
{
textBox1.Font = new Font(textBox1.Font.Name, textBox1.Font.Size+10, textBox1.Font.Style);
}
private void button2_Click(object sender, EventArgs e) //缩小
{
textBox1.Font = new Font(textBox1.Font.Name, textBox1.Font.Size - 10, textBox1.Font.Style);
}
private void button3_Click(object sender, EventArgs e) //变色
{
textBox1.ForeColor = Color.Blue;
}
private void button4_Click(object sender, EventArgs e) //变字体
{
textBox1.Font = new Font("方正舒体", textBox1.Font.Size, textBox1.Font.Style);
}
private void button1_Click(object sender, EventArgs e) //放大
{
textBox1.Font = new Font(textBox1.Font.Name, textBox1.Font.Size+10, textBox1.Font.Style);
}
private void button2_Click(object sender, EventArgs e) //缩小
{
textBox1.Font = new Font(textBox1.Font.Name, textBox1.Font.Size - 10, textBox1.Font.Style);
}
private void button3_Click(object sender, EventArgs e) //变色
{
textBox1.ForeColor = Color.Blue;
}
private void button4_Click(object sender, EventArgs e) //变字体
{
textBox1.Font = new Font("方正舒体", textBox1.Font.Size, textBox1.Font.Style);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询