471,310 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

listview offset

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
Jul 7 '08 #1
3 1717
On Jul 7, 2:24*pm, lior_kovar...@yahoo.com wrote:
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?
Jul 7 '08 #2
On Jul 7, 10:23*pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
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.

Jul 8 '08 #3
On Jul 7, 10:23*pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
On Jul 7, 2:24*pm, lior_kovar...@yahoo.com wrote:


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?- 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.
Jul 8 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Anushya | last post: by
reply views Thread by Anushya | last post: by
reply views Thread by keith | last post: by
6 posts views Thread by Kovan A. | last post: by
7 posts views Thread by Dave Y | last post: by
19 posts views Thread by Owen T. Soroke | last post: by
7 posts views Thread by BobAchgill | last post: by
4 posts views Thread by Brian Gaze | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.