By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

listview offset

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.