0

Im using the TX TextEditingControl (free version) and I think this is absolutely great.

But I cant seem to get the RTF (Text) content that I need.

//Define
private TXTextControl.TextControl rtf = new  TXTextControl.TextControl();


 [...code...]

    private void button_Click(object sender, EventArgs e) {..


   //rtf.Save(s, TXTextControl.StreamType.RichTextFormat);
   //This is what I would like to do but I cant find the property or function that does this.
   string s = rtf.DocumentRTF;

   //Im expecting the standard RTF Format but I get blank
   MessageBox.Show(s);

}
IEnumerable
  • 3,610
  • 14
  • 49
  • 78

2 Answers2

0

Found it! There is no RTF property, to get the output you must use the save() function. Luckily you can write to streams and strings.

       string s = "";

        rtf.Selection.Bold = true;

        //rtf.Selection.Save(TXTextControl.StreamType.RichTextFormat);

        rtf.Save(out s,TXTextControl.StringStreamType.RichTextFormat);

        MessageBox.Show(s);
IEnumerable
  • 3,610
  • 14
  • 49
  • 78
  • Hello. Have you faced with null value of s property as a result of saving? Can't figure out what's wrong. Initial conditions is mostly like yours... – johnny-b-goode Sep 23 '14 at 13:53
0

dear use the following

for Vb.Net

        Dim RegFont As New Font("Arial", UseFontSize, FontStyle.Bold)
        Dim VIPFont As New Font("Arial", UseFontSize, FontStyle.Bold)
        MyRitchText.SelectionFont = VIPFont
        MyRitchText.SelectionAlignment = HorizontalAlignment.Center
        MyRitchText.SelectionColor = Color.Green

for c#

        Font RegFont = new Font("Arial", UseFontSize, FontStyle.Bold);
        Font VIPFont = new Font("Arial", UseFontSize, FontStyle.Bold);
        MyRitchText.SelectionFont = VIPFont;
        MyRitchText.SelectionAlignment = HorizontalAlignment.Center;
        MyRitchText.SelectionColor = Color.Green;

thanks :D

Developerzzz
  • 1,123
  • 1
  • 11
  • 26