I am unable to set Rtf property of a RichTextBox control. The code looks like this -
Expand|Select|Wrap|Line Numbers
- string rtfText = richTextBoxControl.Rtf;
- int RTFLoc = rtfText.IndexOf("\\rtf");
- int InsertLoc = rtfText.IndexOf('}', RTFLoc) - 1;
- rtfText = rtfText.Insert(InsertLoc, @"{\colortbl ;\red255\green0\blue0;" + @"\red0\green255\blue0;" + @"\red0\green0\blue255;}");
- richTextBoxControl.Rtf = rtfText;
1. I am trying to insert color table in RTF header. It doesn't exist before.
2. All search locations are not -1. They are valid locations.
The problem is that even after
Expand|Select|Wrap|Line Numbers
- richTextBoxControl.Rtf = rtfText;
Anybody knows this bug/feature? :)