title: How to make a text in the textbox both bold and italic?
body: <p>I'm new to C# language. So I've created a form in Visual Studio and there are 3 checkboxes on it named Bold, Italic and Underlined. There is also a textbox. When I check the "Bold" checkbox, it makes my text bold and all the other checkboxes work like this but when I try to check 2 or all of them, only one of them works. Here's the code I wrote for making the text both bold and italic by checking the first and second checkbox and absolutely doesn't work:</p>
  
  <pre><code>if (checkBox1.Checked == true &amp;&amp; checkBox2.Checked == true)
  {
      textBox1.Font = new Font(textBox1.Font, FontStyle.Bold);
      textBox1.Font = new Font(textBox1.Font, FontStyle.Italic);
  }
  </code></pre>
  
  <p>I also have a combobox for font size and it works well but when I check the "Bold" checkbox and then change the font size, it goes back to regular font style and doesn't stay bold.
  What should I do?</p>