list view question: GetItemAt method doesn't work

L

Linda Chen

I try to use GetItemAt method inside my mouse_down event,
but it always return null value to me. Here is my sample
code:

private void listFileHistory_MouseDown(object sender,
MouseEventArgs e)
{

System.Windows.Forms.ListViewItem item =
this.listFileHistory.GetItemAt(e.X, e.Y);
}

Any idea?

Thanks

Linda Chen
 
C

Claes Bergefall

That code works fine for me.
Are you sure you're clicking on the item?
Does the item become selected afterwards?

/claes
 

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