943,562 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 3019
  • VB.NET RSS
Jul 2nd, 2009
0

ListView DoubleClick wont fire

Expand Post »
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
VB.NET Syntax (Toggle Plain Text)
  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
VB.NET Syntax (Toggle Plain Text)
  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
VB.NET Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 23
Solved Threads: 1
Newbie Poster
winkler is offline Offline
12 posts
since Jul 2009
Jul 3rd, 2009
0

Re: ListView DoubleClick wont fire

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.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jul 3rd, 2009
0

Re: ListView DoubleClick wont fire

hi frnd,if you want on Listview double click then,use the below event

VB.NET Syntax (Toggle Plain Text)
  1. Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
  2. MsgBox ("")
  3. End Sub
Reputation Points: 0
Solved Threads: 8
Posting Whiz
sonia sardana is offline Offline
326 posts
since Mar 2008
Jul 3rd, 2009
0

Re: ListView DoubleClick wont fire

Use DoubleClick event instead of MouseDoubleClick.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jul 5th, 2009
0

Re: ListView DoubleClick wont fire

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.
Reputation Points: 23
Solved Threads: 1
Newbie Poster
winkler is offline Offline
12 posts
since Jul 2009
Jul 5th, 2009
0

Re: ListView DoubleClick wont fire

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.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jul 7th, 2009
0

Re: ListView DoubleClick wont fire

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!
Reputation Points: 23
Solved Threads: 1
Newbie Poster
winkler is offline Offline
12 posts
since Jul 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Text Analysis
Next Thread in VB.NET Forum Timeline: Getting Information From Another Form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC