This is a migrated thread and some comments may be shown as answers.

How to style a superscript

1 Answer 130 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 20 Oct 2013, 02:46 PM
I'm adding some text programmatically and then allowing the user to format it for their needs and saved it as a Word document.  In the text that I am programmatically adding I am adding some numbers as a superscript. Currently I turn those blue, then make them smaller to offset them from the main text.  But I really want them to be forced to the top of the line, not the bottom.  In Word I would just set them as superscript.

I have styles for these that is separate from the main text.  I was hoping I can just format their style in a way to either make them an actual superscript, or at least align them to the top to make them look like it.  I would prefer to make the superscript, as this will be exported as a Word document.

Do you have any documentation about how to control the styles for things like this, maybe how to add footnotes and other things as well?  The online documentation only shows various font formatting.  Does the RadRichTextBox allow any more formatting than what is detailed in the documentation?

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 Oct 2013, 04:06 PM
Hi Greg,

Thank you for contacting us.

In RadRichTextBox you can set a text to SuperScript using the following line of code:
this.richTextBox.ChangeBaselineAlignment(Telerik.WinControls.RichTextBox.Model.BaselineAlignment.Superscript);

This will change the selected text's alignment.

I hope this helps. Let me know If there is anything else I can help you with.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Greg
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or