PDF Viewer hosting forms hugging control after closing

北战南征 提交于 2019-12-08 04:16:08

问题


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 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?


回答1:


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.



来源:https://stackoverflow.com/questions/34092690/pdf-viewer-hosting-forms-hugging-control-after-closing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!