chenqu 发表于 2013-5-18 22:50:00

{紧急}如何TextControl中的内容(包括格式)传递给另一个TextControl

如何TextControl中的内容(包括格式)传递给另一个TextControl。
如何TextControl中的内容(包括格式)传递给另一个TextControl
如何TextControl中的内容(包括格式)传递给另一个TextControl

iceman 发表于 2013-5-20 16:06:00

回复 1楼chenqu的帖子

包括格式传递,可以通过:

private void Form1_Load(object sender, EventArgs e)
      {
            this.textControl1.Load("test.doc", TXTextControl.StreamType.MSWord);

            byte[] fs = new byte[] { };
            this.textControl1.Save(out fs, TXTextControl.BinaryStreamType.InternalUnicodeFormat);

            this.textControl2.Load(fs, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
      }

iceman 发表于 2013-5-20 16:08:00

回复 1楼chenqu的帖子

不包括格式保存:

            this.textControl1.Select(0, 4);
            this.textControl2.Selection.Text = this.textControl1.Selection.Text;

chenqu 发表于 2013-5-20 16:41:00

回复 2楼iceman的帖子

非常感谢。

iceman 发表于 2013-5-21 16:10:00

回复 4楼chenqu的帖子

客气了
页: [1]
查看完整版本: {紧急}如何TextControl中的内容(包括格式)传递给另一个TextControl