PDF Viewer托管表单在关闭后具有控制权 [英] PDF Viewer hosting forms hugging control after closing
问题描述
我的许多C#和VB程序都使用PDFViewer
控件和AxAcroPDFlib
.多年来一直为我提供服务,但是最近,在安装Adobe Reader DC之后,所有使用PDFViewer
的应用程序都开始出现问题.
A bunch of my C# and VB programs utilize PDFViewer
control and AxAcroPDFlib
. It's been serving me well for years but recently, after installing Adobe Reader DC, all applications using PDFViewer
started to have problems.
PDFViewer
真正快速地控制打开的PDF文档.但是,当我关闭带有打开的PDF文档的托管PDFViewer
控件的表单时,该表单需要5到10秒钟的时间才能将控件返回到同一程序中的其他表单.其他形式只是保持禁用状态,沙漏形鼠标指针的作用时间较长.读卡器DC是否应使用新的AxAcroPDFlib
?
PDFViewer
controls open PDF documents really fast, instantly. However, when I go to close the form hosting PDFViewer
control with open PDF document, the form takes anywhere between 5-10 seconds to return control to other form in the same program. Other forms just remain disabled, with hourglass mouse pointer for an extended time. Is there new AxAcroPDFlib
that should be used with Reader DC?
推荐答案
我能够找到问题所在的实际PDFViewer
控件.当安装Adobe Reader DC时,并且如果PDFViewer
控件具有Focus
,则该表单将无法关闭.我添加了FormClosing
事件处理程序,并添加了一些代码以将Focus
分配给除PDFViewer
之外的其他控件,然后我还处置了PDFViewer
实例.像魅力一样工作.
I was able to track down the issue to the actual PDFViewer
control. When Adobe Reader DC is installed, and if PDFViewer
control has Focus
, the form will have trouble closing. I added FormClosing
event handler and added some code to assign Focus
to a control other than PDFViewer
and then I also disposed of PDFViewer
instance. Worked like a charm.
这篇关于PDF Viewer托管表单在关闭后具有控制权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!