Page 1 of 1

Click/Double Click Event

Posted: 10 Aug 2012, 21:45
by ufo973
Hi Everybody!

i can't make it to display a msgbox when clicking/double clicking on a listeview item?

My code...

Code: Select all

Private Sub listview_DblClick(ByVal listItem As ExLVwLibUCtl.IListViewItem, ByVal listSubItem As ExLVwLibUCtl.IListViewSubItem, ByVal button As Integer, ByVal shift As Integer, ByVal x As Single, ByVal y As Single, ByVal hitTestDetails As ExLVwLibUCtl.HitTestConstants)
Msgbox "You Double Clicked Me"
End Sub

Code: Select all

Private Sub listview_Click(ByVal listItem As ExLVwLibUCtl.IListViewItem, ByVal listSubItem As ExLVwLibUCtl.IListViewSubItem, ByVal button As Integer, ByVal shift As Integer, ByVal x As Single, ByVal y As Single, ByVal hitTestDetails As ExLVwLibUCtl.HitTestConstants)
MsgBox "You just click me"
End Sub
And if you can show me how to show the value of the clicked item in the msgbox please.

Re: Click/Double Click Event

Posted: 10 Aug 2012, 21:58
by TiKu
For the events, see the FAQ

What do you mean with "value"? Do you want to know whether the item is Selected? Or whether it is the caret item? Or whether it is checked (if you display checkboxes next to each item)?

Re: Click/Double Click Event

Posted: 10 Aug 2012, 22:19
by ufo973
I think the value is already in the (ByVal listItem As ExLVwLibUCtl.IListViewItem)

So now my question is...
How to popup a msgbox when an item is double clicked in the listview?
Please help me. Thanx

Re: Click/Double Click Event

Posted: 10 Aug 2012, 22:26
by TiKu
Read point 2 of the FAQ. It explains why you don't get the events and also tells you what you have to do to get them.

And I still don't know what you mean by "value". Yes, the listItem object probably contains what you are looking for, but since I don't know what you are looking for, I cannot tell you which property of this object you could use.

Re: Click/Double Click Event

Posted: 10 Aug 2012, 22:35
by ufo973
I understand that most events are disabled by default. But how to enable the double click event please? I am a noob so sorry for lots of questions.

Re: Click/Double Click Event

Posted: 11 Aug 2012, 00:17
by TiKu
Solved via ICQ. If somebody else wants to know how to do this: Open the control's property pages and there you can edit the DisabledEvents property. Of course, you could also change this property at runtime.