添加Axacropdf控件后,列表框双击事件未触发 [英] List box double click event not firing after adding Axacropdf control

查看:194
本文介绍了添加Axacropdf控件后,列表框双击事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,在列表框中显示PDF文件列表。当用户双击列表框中的pdf文件时,程序将启动PDF文件。我最近在我的项目中添加了一个Adobe AxAcroPDF控件,因此用户可以在启动文件之前预览PDF文件。 AxAcroPDF控件将填充在列表框的selectedindexchanged事件中。在我添加此控件后,我注意到列表框的双击事件不再触发。这就像Adobe控件拦截其中一个鼠标点击。我尝试将selectedindexchanged事件中的代码移动到listbox的click事件,它也做了同样的事情。它还会中断鼠标双击事件。我已经有一个按钮与listbox的双击事件做同样的事情,所以用户有另一种方法来启动文件,但我仍然想让双击事件工作。我还有其他选择吗?



 私人  Sub  ListBoxItems_SelectedIndexChanged( ByVal  sender  As  System。对象 ByVal  e  As  System.EventArgs)句柄 ListBoxItems.SelectedIndexChanged 

Dim sFilePath As 字符串 = SetupSheetPartPath.TrimEnd( \\ \\)& \& SelectedPartNo& \& SelectedOperation& \& Me .ListBoxItems.SelectedItem& 。pdf

.AxAcroPDF1.LoadFile(sfilepath)
.AxAcroPDF1.gotoFirstPage()
.AxAcroPDF1.setShowToolbar( False

结束 Sub





 私有  Sub  ListBoxItems_DoubleClick( ByVal  sender 作为 对象 ByVal  e 作为 System.EventArgs)句柄 ListBoxItems.DoubleClick 

' Me.BtnViewSelectedItem.PerformClick()

MsgBox( 双击


结束 Sub

解决方案

I have a project that displays a list of PDF files in a listbox. When the user double clicks on a pdf file in the list box, the program launches the PDF file. I recently added an Adobe AxAcroPDF control to my project so the user can preview the PDF file before launching the file. The AxAcroPDF control gets populated in the listbox's selectedindexchanged event. After I added this control in, I noticed that the listbox's double click event no longer fires. It is like the Adobe control is intercepting one of the mouse clicks. I tried moving the code from the selectedindexchanged event to the listbox's click event and it does the same thing. It also interrups the mouse double click event. I already have a button that does the same thing as the listbox's double click event so the user has an alternate method to launch the file but I would still like to get the double click event to work. Do I have any other options?

Private Sub ListBoxItems_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBoxItems.SelectedIndexChanged

     Dim sFilePath As String = SetupSheetPartPath.TrimEnd("\") & "\" & SelectedPartNo & "\" & SelectedOperation & "\" & Me.ListBoxItems.SelectedItem & ".pdf"

     Me.AxAcroPDF1.LoadFile(sfilepath)
     Me.AxAcroPDF1.gotoFirstPage()
     Me.AxAcroPDF1.setShowToolbar(False)

End Sub



Private Sub ListBoxItems_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBoxItems.DoubleClick

        'Me.BtnViewSelectedItem.PerformClick()

        MsgBox("Double click")


    End Sub

解决方案

这篇关于添加Axacropdf控件后,列表框双击事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆