Ok i am using a list-tree-view and when you right click it opens a menu. However i want to send a mouse left click BEFORE the user right clicks so it selects that file that they right click on.
Thanks :wave:
Printable View
Ok i am using a list-tree-view and when you right click it opens a menu. However i want to send a mouse left click BEFORE the user right clicks so it selects that file that they right click on.
Thanks :wave:
can't you just set HotTracking = True?
Tryed that, No that does not work all the time because it still won't select it sometimes if the user right clicks too fast on a file.
Try this. Not left mouse click neededVB 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