| | |
ListView DoubleClick wont fire
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
Hi all, it's my first time in this forum, I hope you can help.
I've searched the web for a long time, couldn't find help, yet.
I have a listview that displays a list of PDF files. When the user clicks on a row (in the "selectedIndexChanged" event), I display the selected PDF underneath the Listview in a Webbrowser control
So far so good.
Additionally, when the user double clicks a row on the ListView (in the "DoubleClick" event), I use
where sFile is the name of the PDF file, to open Adobe Acrobat Reader in a separate process.
Now here's the problem: This only works when the user double clicks the currently selected row. If however, the user double clicks on a row that is not selected in the list view, the application produces two "SelectedIndexChanged" events, and no double click event.
What I've discovered is that if I comment out the line
then my code works as expected. A single click produces a "selectedIndexChanged", a double click produces a "selectedIndexChanged" and a "DoubleClick".
So it seems as if calling WebBrowser1.Navigate(sFile) somehow interrupts the events from firing correctly.
Any ideas on how I could solve this issue?
Thank you.
Winkler
I've searched the web for a long time, couldn't find help, yet.
I have a listview that displays a list of PDF files. When the user clicks on a row (in the "selectedIndexChanged" event), I display the selected PDF underneath the Listview in a Webbrowser control
VB.NET Syntax (Toggle Plain Text)
WebBrowser1.Navigate(sFile)
Additionally, when the user double clicks a row on the ListView (in the "DoubleClick" event), I use
VB.NET Syntax (Toggle Plain Text)
Process.Start(sFile)
Now here's the problem: This only works when the user double clicks the currently selected row. If however, the user double clicks on a row that is not selected in the list view, the application produces two "SelectedIndexChanged" events, and no double click event.
What I've discovered is that if I comment out the line
VB.NET Syntax (Toggle Plain Text)
WebBrowser1.Navigate(sFile)
So it seems as if calling WebBrowser1.Navigate(sFile) somehow interrupts the events from firing correctly.
Any ideas on how I could solve this issue?
Thank you.
Winkler
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
hi frnd,if you want on Listview double click then,use the below event
VB.NET Syntax (Toggle Plain Text)
Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick MsgBox ("") End Sub
Well, thank you for your suggestion, but it did not change anything in my situation.
I did, however, find a different workable solution.
ListView has an "activated" attribute, which, when set to "Two Clicks" activates the selected row on the listview in two clicks. This differs from "DoubleClick" because "Two Clicks" allows for some time to elapse between the two.
I put the Process.Start(sFile) into the ListView1_ItemActivate() event and voila! It works!
I did, however, find a different workable solution.
ListView has an "activated" attribute, which, when set to "Two Clicks" activates the selected row on the listview in two clicks. This differs from "DoubleClick" because "Two Clicks" allows for some time to elapse between the two.
I put the Process.Start(sFile) into the ListView1_ItemActivate() event and voila! It works!
![]() |
Similar Threads
- ListView in VB.Net (VB.NET)
- Retrieving Form Variable (Visual Basic 4 / 5 / 6)
- A8N Sli Deluxe (Troubleshooting Dead Machines)
- help with hijack this log, i just post it in windows xp but then read that it should (Viruses, Spyware and other Nasties)
- checkbox value in gridview problem [asp.net 2005 with c#] (ASP.NET)
- Dynamic Buttons in Datagrid Not Firing (ASP.NET)
- Open a form by variable (Visual Basic 4 / 5 / 6)
- ListView, CheckBox, DoubleClick (VB.NET)
- New Computer wont power up (Troubleshooting Dead Machines)
- Brand new Dell wont power up at all (Motherboards, CPUs and RAM)
Other Threads in the VB.NET Forum
- Previous Thread: list all security groups in active directory
- Next Thread: Getting Information From Another Form
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic beginner bing browser button buttons center check code crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags google hardcopy html images input insert intel internet mobile monitor net networking objects open output panel passingparameters pdf picturebox port position print printing problem project save searchbox searchvb.net select serial settings shutdown soap sqlserver survey table tcp temperature text textbox timer timespan toolbox transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year






