snProgrammer
Programmer
Hello,
I have the strangest problem working with a RichTextBox. I want the user to be able to select a chunk of text in a RTF box and make the text bold by clicking a button. This works fine the first time, but the second time not at all. In fact, when I did a step by step through the code, I found that the SelectionStart and SelectionLength values were both 0 for the second try. Here's the relevant code...
private void btn_Click(object sender, System.EventArgs e)
{
rtbInstrument.SelectionFont = new Font("Microsoft Sans Serif", (float)8.25, FontStyle.Bold);
}
Any ideas? Thanks in advance.
Sue
I have the strangest problem working with a RichTextBox. I want the user to be able to select a chunk of text in a RTF box and make the text bold by clicking a button. This works fine the first time, but the second time not at all. In fact, when I did a step by step through the code, I found that the SelectionStart and SelectionLength values were both 0 for the second try. Here's the relevant code...
private void btn_Click(object sender, System.EventArgs e)
{
rtbInstrument.SelectionFont = new Font("Microsoft Sans Serif", (float)8.25, FontStyle.Bold);
}
Any ideas? Thanks in advance.
Sue