←选择平台

操作事件

总结

在此文档查看器中调用操作时发生。

语法
c#
VB
c++
公共事件EventHandler <DocumentViewerOperationEventArgs>操作
公共事件操作作为EventHandler (Leadtools.Document.Viewer.DocumentViewerOperationEventArgs)
公共事件EventHandler < UI Leadtools::文档::::DocumentViewerOperationEventArgs ^ > ^操作
讲话

操作事件在文档查看器执行操作时发生。控件上呈现页面的占位符时视图,当添加一个新的注释对象时,等等。

每一个操作事件触发两次,第一次使用值DocumentViewerOperationEventArgs。IsPostOperation设置为表示操作即将发生。然后用DocumentViewerOperationEventArgs。IsPostOperation设置为真正的表示操作已完成。

操作类型存储在操作.当IsPostOperation,一些操作允许用户更改行为或终止操作。

文档查看操作获取所有文档查看器操作的详细列表。

DocumentViewerOperationEventArgs

例子

中创建的示例开始主题是,删除Example函数中的所有代码并添加下面的代码。

当用户单击示例按钮时,当用户单击页面中的链接并显示消息框时,我们将拦截用户。

c#
VB
使用Leadtools;使用Leadtools.Controls;使用Leadtools.Document;使用Leadtools.Document.Viewer;使用Leadtools.Codecs;使用Leadtools.Caching;使用Leadtools.Annotations.Engine;使用Leadtools.Ocr;//禁用示例按钮,这应该只运行一次exampleButton。启用了=_documentViewer。操作+= (sender, e) =>如果(e.Operation == DocumentViewerOperation。e.IsPostOperation)varlink = (DocumentLink) . data1;控制台。WriteLine ("在指定位置的链接被单击并忽略:"+ link.Bounds.ToString ());e.Abort =真正的};
进口Leadtools进口Leadtools。控制进口Leadtools。文档进口Leadtools.Document.Viewer进口Leadtools。编解码器进口Leadtools。缓存进口Leadtools.Annotations.Engine进口Leadtools。光学字符识别'禁用示例按钮,这应该只运行一次exampleButton。启用了=AddHandler_documentViewer。操作,(发送者,e)如果e.Operation = DocumentViewerOperation。RunLink需要说明e.IsPostOperation然后昏暗的链接作为DocumentLink =CType(e.Data1 DocumentLink)对话框。显示("在指定位置的链接被单击并忽略:"+ link.Bounds.ToString ())e.Abort =真正的结束如果结束
事件数据
参数 类型 描述
发送方 对象 事件的来源。
e DocumentViewerOperationEventArgs 事件数据。
需求
目标平台
Leadtools.Document.Viewer.WinForms组装
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。