Son yapılan işlemi bir yerde tut
int SonislemSira = 0;
void Sonislem()
{
switch (SonislemSira)
{
case 0:
textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Strikeout);
break;
case 1:
textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Underline);
break;
case 2:
textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Italic);
break;
case 3:
textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Bold);
break;
default:
break;
}
}
private void Checkstrikeout_CheckedChanged(object sender, EventArgs e)
{
if (Checkstrikeout.Checked) { textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Strikeout); SonislemSira = 0; }
else { Sonislem(); }
}
private void Checkunderline_CheckedChanged(object sender, EventArgs e)
{
if (Checkunderline.Checked) { textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Underline); SonislemSira = 1; }
else { Sonislem(); }
}
private void Checkitalic_CheckedChanged(object sender, EventArgs e)
{
if (Checkitalic.Checked) { textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Italic); SonislemSira = 2; }
else { Sonislem(); }
}
private void CheckBold_CheckedChanged(object sender, EventArgs e)
{
if (CheckBold.Checked) { textBox1.Font = new Font(textBox1.Font, textBox1.Font.Style ^ FontStyle.Bold); SonislemSira = 3; }
else { Sonislem(); }
}