Listview: How to know which column has been selected

P

Peter

Hi,

I can detect which ListviewItem has been selected like the code below, but I
can't detect which subItem has been selected. Any help will be great
appreciated.

Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
dim lvItem As ListViewItem
lvItem = Me.ListViewMethod.GetItemAt(e.X, e.Y)

End sub

Peter
 
R

Ronchese

Use:
ListView1.SelectedItems(0)



[]s
Cesar



"Peter" <[email protected]> escreveu na mensagem
Hi,

I can detect which ListviewItem has been selected like the code below, but I
can't detect which subItem has been selected. Any help will be great
appreciated.

Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
dim lvItem As ListViewItem
lvItem = Me.ListViewMethod.GetItemAt(e.X, e.Y)

End sub

Peter
 
P

Peter

Ronchese said:
Use:
ListView1.SelectedItems(0)

Ronchese,
The listview may have several subitems, I mean I want to detect which
subitem is in the place where mouse is at. So I'm not sure I can use
SelectedItems(0), SelectedItems(1) or SelectedItems(2).

Thank you

Peter
 
A

Atul

Send the LVM_GETSUBITEMRECT message to the ListView control. You might have
to use P/Interop

-Atul, Sky Software http://www.ssware.com
Shell MegaPack ActiveX & .Net
Drop In Windows Explorer like Shell Browsing GUI controls for your app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top