ListView

  • Thread starter Thread starter Massimo Zaccarin
  • Start date Start date
M

Massimo Zaccarin

I have a ListView with MultiSelect=True, how can I know witch Item has been
clicked, without looping on each Item?

I need to process only the last clicked Item, but the "Click" event doesn't
tell me anithing about the clicked Item.
I don't want to use the checks (in this case I would trap the ItemChecked
event)

Thanks
 
Hi Massimo,

You may try to see if the code below does the job for you.

Private Sub ListView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ListView1.Click
Dim itemPoint As Point = ListView1.PointToClient(Cursor.Position)
' This is the item that was clicked
Dim selectedItem As ListViewItem = ListView1.GetItemAt(itemPoint.X,
itemPoint.Y)
End Sub

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 
Hi Peter...

I started a thread a few days ago (but nobody from MS responded) and I
replied to another MS message with this question but again there was no
response. So I'll try responding to this one.

The question is concerning why the replies from MS (with rare exception)
quotes the entire header of the message they are responding to. Note the
header in this reply (which I've made) to your message and the header you
generated in your reply. The entire path, the newsreader used, the priority
and everything else is repeated.

Is this something which A) you think is really good idea? In which case
wouldn't it be neat if we all started doing that? Or, B) something that
your software does that you can't stop?

Perhaps you can tell us what software you are using. Given a little
information we might be able to form a reasonable "request" that the
practice be reconsidered as personally I think it adds a layer of noise
which detracts from the information contained in a response. Obviously it
isn't the end of the world but if it is some oversight or can be turned off
I don't think that would bother anybody who reads the messages.

Tom
 
Hi Tom,


We quote the previous post, just to help community to read the whole post
when the broken thread occurred.
If this cause trouble for you , I am sorry.
Yes I can set the option to not include the previous post.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Peter...

This wasn't about "quoting the previous post" we all do that. Note the
difference with your reply this time and the one I cut and paste to the end.
Look at the header which was duplicated. No other replies except the MS
replies include that header.

What software do you use that it posts back things like the following:
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

Tom


Peter Huang said:
Hi Tom,

We quote the previous post, just to help community to read the whole post
when the broken thread occurred.
If this cause trouble for you , I am sorry.
Yes I can set the option to not include the previous post.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Hi Massimo,

You may try to see if the code below does the job for you.

Private Sub ListView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ListView1.Click
Dim itemPoint As Point = ListView1.PointToClient(Cursor.Position)
' This is the item that was clicked
Dim selectedItem As ListViewItem = ListView1.GetItemAt(itemPoint.X,
itemPoint.Y)
End Sub

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
 
Hi Tom,

This is by default in our tools when we wants to include the replied
message.
If that give me some trouble, I am sorry, and I will cut the message header.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
I've found that the listView has a "FocusedItem" property that returns the
item with the focus i.e. the last clicked

Massimo
 
Back
Top