I am embedding Adobe Acrobat in our c# program by inheriting AxHost and passing in the Acrobat guid("ca8a9780-280d-11cf-a24d-444553540000")
to the base constructor. To load a pdf I call InvokeMember("LoadFile")
. The problem I am running into is after calling "LoadFile" and the PDF loads, Acrobat takes the focus in our form. Being Acrobat apparently starts loading on another thread, calling focus on the control that previously had focus, doesn't fix the problem. So does anyone have any idea of how I can prevent this from occurring?
我通过继承AxHost并将Acrobat guid(“ca8a9780-280d-11cf-a24d-444553540000”)传递给基础构造函数,在我们的c#程序中嵌入Adobe Acrobat。要加载pdf,我调用InvokeMember(“LoadFile”)。我遇到的问题是在调用“LoadFile”并加载PDF后,Acrobat将焦点放在我们的表单中。由于Acrobat显然开始加载另一个线程,将焦点调用以前具有焦点的控件,并不能解决问题。那么有谁知道如何防止这种情况发生?
1 个解决方案
#1
Try the below snippet.......
试试下面的片段.......
this.Refresh();
axAcroPDF1.Focus();
axAcroPDF1.SendToBack();
**AnyControl**.Focus();
this.Refresh();
#1
Try the below snippet.......
试试下面的片段.......
this.Refresh();
axAcroPDF1.Focus();
axAcroPDF1.SendToBack();
**AnyControl**.Focus();
this.Refresh();