Hi !
I want to know how can i add an option such when a user will use the "right click" with the mouse on some item in the listview control , i will open some menu bar and the user be able to preform some operation on this item .
ThX .
Printable View
Hi !
I want to know how can i add an option such when a user will use the "right click" with the mouse on some item in the listview control , i will open some menu bar and the user be able to preform some operation on this item .
ThX .
VB Code:
Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = vbRightButton Then 'do your thing End If End Sub
do a search for
listview popupmenu
1. you basically create a menu
2. put some code in the mousedown event that checks to see if the right mouse was clicked (button = 2)
3. use the me.popupmenu method to show a menu that you created somewhere.
If you can't find it, I'll give you some sample code.
don't forget that you can use the X and Y pos to HitTest and get the selected list item
- gaffa
Make a menu ("like File Edit..etc") but dont make it visible, and then use the code below
VB Code:
Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = vbRightButton Then popUpMenu mnuFile 'opens File menu when u right click End If End Sub