Hi Bob,

I dunno where you are, but I'm in the UK and it's 8:20am, just arrived at work. I searched for that bit of code last night at home, and it's nowhere to be found. The best I can offer at the moment is a simplified explanation of how it worked.

Basically when you click on a listitem, the number of the item you clicked is stored in one parameter. When you move the mouse and release it, the number of the item under the mousepointer is stored in another parameter, giving you a start point and end point for the listitems you need to modify. For example, if you pick row 3 and want to move it to row 5, then item 3 is saved to a temporary buffer, rows 4 and 5 are moved up one row, and the item which was at row 3, is pasted to row 5. All of that is simple enough in concept.

I've just had a go at writing the code to do this, and the only problem I haven't been able to figure out (in the 10 minutes or so that I spent on it), is how to work out which row is under the mouse pointer when the mouse button is released.

You'll also need to access the Properties page for the ListView, and set the following:-

OLEDragMode = 1 - ccOLEDragAutomatic
OLEDropMode = 1 - ccOLEDropManual

Hope that's of some use to you. In the meantime, I'll have another look for that piece of code, and post here again if I have any luck.