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
Sijin Joseph - 14 Oct 2004 04:49 GMT
You might need to convert the screen co-ordinates to client co-ordinates
System.Windows.Forms.ListViewItem item =
this.listFileHistory.GetItemAt(listFileHistory.PointToClient(e.X, e.Y));
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> I try to use GetItemAt method inside my mouse_down event,
> but it always return null value to me. Here is my sample
[quoted text clipped - 13 lines]
>
> Linda Chen
Claes Bergefall - 14 Oct 2004 08:20 GMT
That code works fine for me.
Are you sure you're clicking on the item?
Does the item become selected afterwards?
/claes
> I try to use GetItemAt method inside my mouse_down event,
> but it always return null value to me. Here is my sample
[quoted text clipped - 13 lines]
>
> Linda Chen