I am testing a windows application and have selected an item in a listbox. I then need to drag that item to a different listbox. The problem is I can't find how to obtain the mouse co-ordinates for the drag as the recorder doesn't pull these back. The co-ordinates will not be the same everytime so I need to get the location of the selected item before I drag it to a different listbox.
I have looked for a GetLocation () type of command but can't find one, is there any way that I can obtain the co-ordinates before I begin my drag.
I've thought about this, but this isn't working as GetPosition () isn't working on the specified listbox. I am just getting an error when compiling saying that the function GetPosition is not defined...
Have you tried using the BeginDrag or EndDrag methods? Supposedly by using these you can specify an identifiable object such as the folder name, thereby eliminating having to use co-ordinates at all. The only caveat with using these methods is that they can only be used on a listview, treeview or list box. Look in the help files for more information.
In the past, I've had to figure out the number of pixels between rows, the location of the first row, then the position of the desired item in the list. This information allows you to figure out where to start the Drag/Drop operation.