|
-
Mar 15th, 2001, 08:08 AM
#1
Thread Starter
New Member
Hi,
I have a listView in Report Mode, and I need to run a function when an item is clicked with the right-mouse button.
I can't seem to find a way, as the mousedown event doesn't return the listitem.
Thanks,
Mark
-
Mar 15th, 2001, 08:37 AM
#2
Lively Member
use the ListView.SelectedItem.Index to get the index of the selected item, if there is no item selected it will resturn and error 'Object Variable Not Set' so u must catch this error.
-
Mar 15th, 2001, 08:39 AM
#3
Fanatic Member
does the hittest method not work in report mode?
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Mar 15th, 2001, 08:40 AM
#4
you can use this:
Code:
Private Sub ListView1_MouseDown(Button As Integer, shift As Integer, x As Single, y As Single)
Dim temp As MSComctlLib.ListItem
If Button = 2 Then
Set temp = ListView1.HitTest(x, y)
If Not temp Is Nothing Then
temp.Selected = True
'-----Your function code here
End If
End If
End Sub
-
Mar 15th, 2001, 09:10 AM
#5
Thread Starter
New Member
Thanks
Thanks ATommasi
That did it
-
Mar 15th, 2001, 09:13 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|