Umm when a user dbl clicks on a listview item, how can I cast from the sender object to a listview item? it doesnt work, dunno how to do it.
I just want to know what item is clicked in the double click event of a listview
tnx :)
Printable View
Umm when a user dbl clicks on a listview item, how can I cast from the sender object to a listview item? it doesnt work, dunno how to do it.
I just want to know what item is clicked in the double click event of a listview
tnx :)
try this in the event...
Dim lv As ListView = CType(sender, ListView)
then you should be able to expose e.g.
lv.selectedindex
ooooh tnx! :)
I was trying to cast from object to listViewitem :p
:)
I'm having problemmos :)
When the uer dblClicks, I want to know what item was clicked. SelectedItems() wont work because the MultiSelect property in my listView is set to true. Also if the user dblClicks on a checkbox next to a listview item, the doubleclick event will fire, but no item was actually clicked.
I need to know if an item was actually clicked and if so which item it is....
any one can help me about this:confused:
bump bump
I thought it's really simple! that's what the title suggests!:p
bump
no really, bump:D
need help peopleZ.... :)
VB Code:
Do MsgBox ("[b]bump[/b]") Loop While True = True
Did you ever find an answer to this?
I need to get the index of the item selected in a listview
naah, I looked back to my project again... I gave up the idea of using check boxes
what's your problem right now? casting? or figuring out if an item was really clicked?
Well, i need to find the index of the item that was clicked.
I have had to use the .FocusedItem because there isn't a .SelectedIndex anymore, but now i have found that the focuseditem isn't necessarly the item clicked....if you can follow what i mean.
If i click on the second item in the listview to send this item to a form to be edited, it will in fact get the first item in the listview not the second or third, ect.
How can you doubleclick multiple items?
'SelectedItems() wont work because the MultiSelect property in my listView is set to true.' If Multiselect is true then it should still work hence the s at the end. It just is a collection of items instead.
Actually, don't worry about my last post, .FocusedItem does still work ok.
I looked at it in debug and poped up a message box and it held the correct index and items, so the problem must be somewhere else. I think it's getting the first item from the array, not sure whats going on yet.
you could just check SelectedItems(0)
Ahhhhhhh, i worked out what the problem was, i forgot to add 1 to the array that was why it was getting the first item all the time.
When i added a third item to the listview it was getting the second one and it then dawned on me what i had done.
This is what happens when your tired and been staring at code for six hours.
Must remember to get up and get out of the house, once in awhile.