This documentation is archived and is not being maintained.

CDragListBox Class

In addition to providing the functionality of a Windows list box, the CDragListBox class allows the user to move list box items, such as filenames, within the list box.

class CDragListBox : public CListBox




Constructs a CDragListBox object.




Called by the framework when a drag operation starts.


Called by the framework when a drag operation has been canceled.


Called by the framework during a drag operation.


Draws the insertion guide of the drag list box.


Called by the framework after the item has been dropped.


Returns the coordinates of the item being dragged.

List boxes with this capability allow users to order the items in a list in whatever manner is most useful to them. By default, the list box will move the item to the new location in the list. However, CDragListBox objects can be customized to copy items instead of moving them.

The list box control associated with the CDragListBox class must not have the LBS_SORT or the LBS_MULTIPLESELECT style. For a description of list box styles, see List-Box Styles.

To use a drag list box in an existing dialog box of your application, add a list box control to your dialog template using the dialog editor and then assign a member variable (of Category Control and Variable Type CDragListBox) corresponding to the list box control in your dialog template.

For more information on assigning controls to member variables, see Shortcut for Defining Member Variables for Dialog Controls.

Header: afxcmn.h