Listview SelectedIndexChanged

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
513
Programming Experience
3-5
It seems that the listview selectedindexchanged will trigger 10 times if i select 10 items, is there a different trigger that will trigger only once at the end of the selection? t gets really slow when i select a lot of items, cause each time a new item is selected, i had different check to see which checkbox to check or what to display on picturebox or text box, what buttons to appear. If i select 10, i just want some to display the first item's info, and some to displace a combine info.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,723
Location
Sydney, Australia
Programming Experience
10+
You can see what events the ListView class has in the MSDN documentation. Do any of them indicate that they would do what you want? If so then use that event, otherwise the answer is "no". Think about it though. How would it work? If you select one item then how would the control know whether or not you were done selecting? If you want to use whether or not the Ctrl or Shift keys are depressed when the event is raised in order to know whether another event might be raised then you can do that but you'll then have to detect when that key is released so that you can then do whatever it is that you need to do.
 

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
513
Programming Experience
3-5
I think that is a good idea. How do you detect if the shift key is depressed when the selectedindexchange trigger? And when its released?
Right now i have it set to trigger a timer that will activate the action. It give a tiny delay 0.2sec after the click but make the whole procress much faster when selecting more. Does this sound like a good solution?
 
Last edited:
Top Bottom