Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please i want to know how to write text like this Hello Hi world

OR How to write subscript text in rtf file uisng C#

Thanks in advance
Posted

In Windows Forms, you can add subscript/superscript text to a RichTextBox.
Follow this link: http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.selectioncharoffset.aspx[^]

If your RichTextBox is named 'richTextBox1', then you can save the RTF into a RTF file:
C#
richTextBox1.SaveFile("filename.rtf");
// change 'richTextBox1' into the name of your RichTextBox
// and change "filename.rtf" into the filename of your RTF file.

For WPF and ASP.NET, I don't know a solution.
 
Share this answer
 
v2
The Rich Text Format file is a simple text file with an old formatting notation specified by Microsoft (http://www.biblioscape.com/rtf15_spec.htm[^]). Thus you can make rtf without any control at all. The control word \dn6 for example will place the following text in subscript 3pt-s below baseline. So you can simply use an rtf writer like this one: http://sourceforge.net/projects/netrtfwriter/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900