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