ninja_aya 发表于 2014-11-18 14:39:00

关于复制黏贴和一个bug

当从控件中复制一段含有域的文本的时候,黏贴到其他地方,该域也会被黏贴过去,请问下有没有什么办法可以只复制黏贴文字和格式,而不复制域。
第二个问题当我从一份word文档中复制一段内容的时候,黏贴到控件中,此时按cirl+z撤销会报错。
ee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: 未知格式。
(01-2001)
at TXTextControl.TextControlCore.?()
at TXTextControl.TextControlCore.?(? , Int32 , Int32 , Int32 )
at TXTextControl.ApplicationFieldCollection.GetItem()
at ETUZBSoft.richTextControl.textControl1_InputPositionChanged(Object sender, EventArgs e)
at TXTextControl.TextControl.OnInputPositionChanged(EventArgs e)
at TXTextControl.TextControl.?(Message& )
at TXTextControl.TextControl.WndProc(Message& message)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
ETUZBSoft
Assembly Version: 1.0.0.7
Win32 Version: 1.0.0.7
CodeBase: file:///C:/Program%20Files%20(x86)/%E6%98%93%E5%9C%9F365/%E6%98%93%E5%9C%9F365%E6%8B%9B%E6%A0%87%E6%96%87%E4%BB%B6%E5%88%B6%E4%BD%9C%E5%B7%A5%E5%85%B7/ETUZBSoft.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL

iceman 发表于 2014-11-18 19:49:00

回复 1楼ninja_aya的帖子

很抱歉,根据当前的描述我还没有办法重现问题,能否请你提供重现问题Demo。我们再进一步调查

ninja_aya 发表于 2014-11-19 11:17:00

这个问题时不时的,有时候编辑的时候按cirl+z会出错,有时候不会出错。请问第一个问题怎么解决。

iceman 发表于 2014-11-19 19:35:00

回复 3楼ninja_aya的帖子

你好,

我理解第一个问题的前几个步骤如下:
1.插入 TextField
2.绑定数据
3.复制 tx 中的文本。

请问需要粘贴到 Word 中还是?

ninja_aya 发表于 2014-11-20 09:53:00

不是,同一个tx文档里面,复制一段里面存在field的文本,黏贴到其他段落时会把field一起复制过去,现只需要复制文本和格式,不想把field一起带过去。

iceman 发表于 2014-11-20 17:42:00

回复 5楼ninja_aya的帖子

问题我们已经了解,测试后给您进一步反馈。谢谢

Alice 发表于 2014-11-24 16:52:00

回复 5楼ninja_aya的帖子

请问你使用的TextControl.Copy方法进行复制么?这个是对当前的选择部分进行复制。
TextControl.GetClipboardFormats可以返回ClipboardFormat的array。
另外TextControl.Paste方法可以传递ClipboardFormat参数。

语法:
public void Paste(ClipboardFormat format);

Public Sub Paste(ByVal format As ClipboardFormat)

成员:format
描述:
指定paste的format。必须是一个ClipboardFormat值。
页: [1]
查看完整版本: 关于复制黏贴和一个bug