Hi Team from Stimulsoft,
I want to use the GetValue Event of a RTF to calcuate some lines. Is it possible to format the lines in the event (e.g. set alignment, set bold etc)?
Thanks a lot
RTF Question
RTF Question
You can use following code in GetValue event of RichText
Code: Select all
StiRichTextBox rich = new StiRichTextBox();
//Unpack rtf text
rich.Rtf = StiRichText.UnpackRtf(System.Xml.XmlConvert.DecodeName(e.Value));
//Select rtf range
rich.SelectionStart = 0;
rich.SelectionLength = 3;
rich.SelectionAlignment = StiRtfSelectionAlign.Center;
rich.SelectionColor = Color.Red;
rich.SelectionFont = new Font("Arial", 30);
//Pack rtf text
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(rich.Rtf));
rich.Dispose();