Click here to Skip to main content
15,889,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created button controls for superscript and subscript for to display in richtextbox

when i inserting chars into richtextbox it will correct results

But after saving it will give no effect


My code is



SQL
if (btnSender.Name.ToUpper() == "BTNSUPERSCRIPT")
                        {
                            if (objRichText.SelectedText != null)
                            {
                                objRichText.SelectionCharOffset = 4;// 5;
                            }
                        }
                        else if (btnSender.Name.ToUpper() == "BTNSUBSCRIPT")
                        {
                            if (objRichText.SelectedText != null)
                            {
                                objRichText.SelectionCharOffset = -4;// -5;
                            }
                        }




Any suggestions
Posted

1 solution

You are only changing the displayed data; you also need to add the RTF control codes to the saved data in your file. See the solutions to How to write subscript text in rtf file[^] for suggestions.
 
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