|
-
Sep 5th, 2005, 01:57 AM
#1
Thread Starter
Frenzied Member
Execute a Menu when List is right clicked
Okay, I have a listview, all filled out etc. I am trying to add a few nice options on to it, and I thought the best way to organize it would be in a Menu. Except, I have a problem:
How would I pop up the menu when a row was right clicked on the listview?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::

-
Sep 5th, 2005, 01:59 AM
#2
Re: Execute a Menu when List is right clicked
VB Code:
Private Sub ServerB_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
PopupMenu PopMenu 'must be valid top level menu item
End If
End Sub
-
Sep 6th, 2005, 08:27 AM
#3
Re: Execute a Menu when List is right clicked
This will popup a menu, and select the item you right mouse clicked on.
VB Code:
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lvwItem As ListItem
If Button = vbRightButton Then
Set lvwItem = ListView1.HitTest(x, y)
If Not lvwItem Is Nothing Then
lvwItem.Selected = True
PopUpMenu mnuFile
End If
End If
End Sub
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
|