- May 7, 2013
- 10,400
Code:
richTextBox1.Text.IndexOf("[B]");
richTextBox1.SelectionFont = new Font(richTextBox1.Font.FontFamily, richTextBox1.Font.Size, FontStyle.Bold);
I've made a little test button on the form to test the code with, and I've noticed a slight problem; although the code works fine, once the method becomes true (I assume it's boolean right?), the entire font for the text box becomes bold.
I figured maybe use a variable or something, but then you can't change the font?