Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?

VB
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


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

        'Me.BtnViewSelectedItem.PerformClick()

        MsgBox("Double click")


    End Sub
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900