ListView DoubleClick wont fire

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
Reply

Join Date: Jul 2009
Posts: 4
Reputation: winkler is an unknown quantity at this point 
Solved Threads: 0
winkler's Avatar
winkler winkler is offline Offline
Newbie Poster

ListView DoubleClick wont fire

 
0
  #1
Jul 2nd, 2009
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
  1. WebBrowser1.Navigate(sFile)
So far so good.
Additionally, when the user double clicks a row on the ListView (in the "DoubleClick" event), I use
  1. Process.Start(sFile)
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
  1. WebBrowser1.Navigate(sFile)
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,425
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 434
adatapost's Avatar
adatapost adatapost is online now Online
Nearly a Posting Maven

Re: ListView DoubleClick wont fire

 
0
  #2
Jul 3rd, 2009
Welcome winkler,

Event selectedIndexChanged will be fired when index of an item get changed. But with DoubleClick - There is no way to execute selectedIndexChanged.

Please verify your code.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: ListView DoubleClick wont fire

 
0
  #3
Jul 3rd, 2009
hi frnd,if you want on Listview double click then,use the below event

  1. Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
  2. MsgBox ("")
  3. End Sub
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,425
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 434
adatapost's Avatar
adatapost adatapost is online now Online
Nearly a Posting Maven

Re: ListView DoubleClick wont fire

 
0
  #4
Jul 3rd, 2009
Use DoubleClick event instead of MouseDoubleClick.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 4
Reputation: winkler is an unknown quantity at this point 
Solved Threads: 0
winkler's Avatar
winkler winkler is offline Offline
Newbie Poster

Re: ListView DoubleClick wont fire

 
0
  #5
Jul 5th, 2009
Thank you for your ideas. I tried them and they don't work. Any other ideas? Anyone know about simulating a double click event by timing the interval between the clicks?
Thank you.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,425
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 434
adatapost's Avatar
adatapost adatapost is online now Online
Nearly a Posting Maven

Re: ListView DoubleClick wont fire

 
0
  #6
Jul 5th, 2009
wrinkler,

It's not an idea. It's a suggestion and it must has to work.
Last edited by adatapost; Jul 5th, 2009 at 4:25 am.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 4
Reputation: winkler is an unknown quantity at this point 
Solved Threads: 0
winkler's Avatar
winkler winkler is offline Offline
Newbie Poster

Re: ListView DoubleClick wont fire

 
0
  #7
Jul 7th, 2009
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!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC