using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace V8.___CheckBox_控件 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (ct.Checked==true ) { if (xt.Checked == true) { if (ucb.Checked == true){ textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline); }else{ textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic); } } else { if (ucb.Checked == true) { textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Underline); } else { textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Italic); } } } else { if (xt.Checked == true) { if (ucb.Checked == true){ textBox1.Font = new Font(textBox1.Font, FontStyle.Italic | FontStyle.Underline); } }else { if (ucb.Checked == true) { textBox1.Font = new Font(textBox1.Font, FontStyle.Underline); } } } } } }
|
|
来自: 时间剧毒 > 《第十二章:Windows窗体技术及基础控件》