How To Arrange Order of List Items within ListBox Control (167746)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q167746 SUMMARY
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.
REFERENCES
For additional information on how to drag-and-drop onto a list box, please
see the following articles in the Microsoft Knowledge Base:
80187
: How To Drop Item into Specified Location in VB List Box
(c) Microsoft Corporation 1997, All Rights Reserved.
Contributions by Adrian Chiang, Microsoft Corporation.
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto KB167746 |
---|
|