0

我正在使用 TX TextEditingControl(免费版),我认为这绝对很棒。

但我似乎无法获得所需的 RTF(文本)内容。

//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);

}
4

2 回答 2

0

找到了!没有 RTF 属性,要获得输出,您必须使用 save() 函数。幸运的是,您可以写入流和字符串。

       string s = "";

        rtf.Selection.Bold = true;

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

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

        MessageBox.Show(s);
于 2014-02-16T09:54:53.417 回答
0

亲爱的使用以下

对于 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

对于 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;

感谢:D

于 2014-02-16T10:07:13.160 回答