views:

501

answers:

2

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

A: 

Try the below snippet.......

        this.Refresh();
        axAcroPDF1.Focus();
        axAcroPDF1.SendToBack();

        **AnyControl**.Focus();
        this.Refresh();
A: 

Hi, I have the same problem. Loading a PDF document using the activeX AxAcroPDFLib.AxAcroPDF activates some threads which set focus to the activeX control. So the focus on my previous control is lost.

I have tryed the above snippet in vain.

Has anybody found another solution?

crabb