我使用的是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);
}发布于 2014-02-16 17:54:53
找到了!没有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-16 18:07:13
尊敬的朋友,请使用以下内容
对于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
https://stackoverflow.com/questions/21809526
复制相似问题