Article ID: 167746 - View products that this article applies to.
This article was previously published under Q167746
This article has been archived. It is offered "as is" and will no longer be updated.
This article contains sample code that illustrates how to arrange the order of items within ListBox Control using drag-and-drop. Function ListRowCalc() returns the list index by calculating the position using the Windows API SendMessage() function with the constant LB_GETITEMHEIGHT and Screen.TwipsPerPixelY. Sub ListRowMove inserts the dragged item into the dropped position and re-orders all other affected items.
For additional information on how to drag-and-drop onto a list box, please see the following articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/80187/EN-US/ ): How To Drop Item into Specified Location in VB List Box
(c) Microsoft Corporation 1997, All Rights Reserved.
Contributions by Adrian Chiang, Microsoft Corporation.
Article ID: 167746 - Last Review: February 28, 2014 - Revision: 2.1
Contact us for more help