472,958 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1767
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
6
by: Kovan A. | last post by:
since i couldnt find anyway to scroll a listview having disabled the scrollbars, i am left with no choice but to make the current scrollers bigger any leads as to which beast i am up against for...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.