1

我在 C# winform 应用程序中有一个嵌入式 Acrobat 查看器。查看器位于选项tabPage1卡控件的选项卡页中

我使用此答案中的代码:(1)

CAcroAVDoc acroExchAVDoc;
CAcroPDDoc pdDoc; 

void CreatePdfViewerAndOpenFile(string pdfFile)
{
    short AV_DOC_VIEW = 2;
    short PDUseBookmarks = 3;
    short AVZoomFitWidth = 2;

    Type AcroExch_AVDoc = Type.GetTypeFromProgID("AcroExch.AVDoc");
    acroExchAVDoc = (Acrobat.CAcroAVDoc)Activator.CreateInstance(AcroExch_AVDoc);
    bool ok = acroExchAVDoc.OpenInWindowEx(pdfFile, tabPage1.Handle.ToInt32(), AV_DOC_VIEW, -1, 0, PDUseBookmarks, AVZoomFitWidth, 0, 0, 0);
    pdDoc = (CAcroPDDoc)acroExchAVDoc.GetPDDoc();
}

我想强制查看器捕获鼠标滚轮,以便文件滚动。

当我切换到另一个窗口并返回应用程序时,我发现标签页名称集中,并且文件不滚动。

我使用 Adob​​e Acrobat DC。有没有办法做到这一点?

4

1 回答 1

0

查看器在聚焦时会滚动吗?

如果是,只需在您的表单再次激活时将焦点重新设置在查看器上。

您始终可以将 WM_MOUSEWHEEL 发送给查看器。在这里阅读

于 2015-05-25T13:39:35.557 回答