Page 1 of 1
Subscript/Superscript - Possible?
Posted: Thu Aug 24, 2006 10:40 pm
by fphealthcare
Is it possible to show super and sub scripts on the report? I've tried using RichText, but that only allows you to change fonts, size, colors, and allows underlines and stikeouts, but not change to sub or superscipt. Is this possible?
Subscript/Superscript - Possible?
Posted: Thu Aug 24, 2006 11:31 pm
by Vital
You can use property RtfText of RichText. This property contains rtf text.
Thanks.
Subscript/Superscript - Possible?
Posted: Fri Aug 25, 2006 12:49 am
by garethm
Just to clarify that, if you use the RtfText property, you can specify raw rtf - and using raw rtf you use \sub and \super to indicate sub- and superscript, respectively.
e.g. SO{\sub 4}{\super -2} gives you SO followed by a subscript 4 and a superscript -2.
Subscript/Superscript - Possible?
Posted: Fri Aug 25, 2006 6:27 am
by Vital
We will update our rtf editor. Please send message to support, we will send you patch, when it will be ready.
Thank you.
Subscript/Superscript - Possible?
Posted: Wed Sep 06, 2006 5:42 pm
by fphealthcare
I've downloaded the new version with the new rfg editor and it has sub/superscript working very well. I want to be able to change the text value (including formatting such as sub/superscript) of the rich text in code. How can this be done?
e.g.
I've got a rich text box RichText1. I want to change RichText1 to display "ABC123".
How can I do this?
Thanks
Subscript/Superscript - Possible?
Posted: Fri Sep 08, 2006 12:28 am
by Vital
Type following code in GetValue event of RichText
Code: Select all
RichTextBox rich = new RichTextBox();
//Unpack rtf text
rich.Rtf = StiRichText.UnpackRtf(System.Xml.XmlConvert.DecodeName(e.Value));
//Select rtf range
rich.SelectionStart = 0;
rich.SelectionLength = 3;
//Subscript
rich.SelectionCharOffset = -4;
//Superscript
rich.SelectionCharOffset = 4;
//Pack rtf text
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(rich.Rtf));
rich.Dispose();