listview offset

  • Thread starter Thread starter lior_kovarsky
  • Start date Start date
L

lior_kovarsky

I have a listview with large icons. When user clicks, say the top left
of an icon, and in
the mouse down event i have
Point p = listview1.PointToClient(new Point(MousePosition.X,
MousePosition.Y)),
if I then compare p to listviewitem.Position, where listviewitem is
the icon the user clicked,
then in some cases the two points aren't equal. Anyone that can
explain why this offset exists
and is there a way to know what this offset would be? i.e. is there
e.g. a property of the listview
that holds this?


Thanks,

Lior
 
I have a listview with large icons. When user clicks, say the top left
of an icon, and in
the mouse down event i have
Point p = listview1.PointToClient(new Point(MousePosition.X,
MousePosition.Y)),
if I then compare p to listviewitem.Position, where listviewitem is
the icon the user clicked,
then in some cases the two points aren't equal. Anyone that can
explain why this offset exists
and is there a way to know what this offset would be? i.e. is there
e.g. a property of the listview
that holds this?

Thanks,

Lior

and how you know that the user clicked the top left most corner of the
icon?
 
and how you know that the user clicked the top left most corner of the
icon?

The difference between points is sometimes as much as 21 in the X
axis, so
it is not because user didn't click exactly in the top left most
corner.
 
and how you know that the user clicked the top left most corner of the
icon?- Hide quoted text -

- Show quoted text -

the difference in the X axis is sometime around 20 pixels, so it
cannot be explained
by the fact that the click was not exactly at the corner.
 
Back
Top