right click a listbox array?
Code:
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim P As Long, XPosition As Long, YPosition As Long
XPosition = CLng(x / Screen.TwipsPerPixelX)
YPosition = CLng(y / Screen.TwipsPerPixelY)
P = SendMessage(List1.hWnd, LB_ITEMFROMPOINT, 0, ByVal ((YPosition * 65536) + XPosition))
If P < List1.ListCount And Button = vbRightButton Then
List1.ListIndex = P
PopupMenu dsfdsf
End If
End Sub
that code will let me right click a listbox, but how would i do it with an array? can i load that code into a listbox array?