I want to return the column from a ListView the user has selected from a right mouse click event.
Does anyone know how to do this?
Cheers
Printable View
I want to return the column from a ListView the user has selected from a right mouse click event.
Does anyone know how to do this?
Cheers
See the last example on this page:
http://www.thevbprogrammer.com/index...ter=13&Topic=1
When you add the items under the columns, set their tags to the columns owners..then use a HitTest:
That's about the only way I know of.VB Code:
Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 2 Then Dim lvi As ListItem Set lvi = ListView.HitTest(x, y) MsgBox lvi.Tag Set lvi = Nothing End If End Sub
chem
Thanks BruceG, works a treat.
...now to get that column width.
:wave: