Solved

Drag&Drop in CListCtrl

Posted on 1997-11-30
1
685 Views
Last Modified: 2013-11-20
I am implementing a drag&drop for items in a ClistCtrl, as per MFCDrag sample. Everything works fine until I change the style of my ClistCtrl to OwnerDraw. From that point on, the CreateDragImage function creates a drag image only for the icon and not for the text label. Where is the trick?
0
Comment
Question by:winmeister
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1311117
The default wndproc for the list control can create the drag image for your items because it knows how to draw the text. But if your control is owner-drawn, then the default handler cannot possibly know how to draw your items. The only thing it does know how to draw is the icon (bitmaps). So you are in charge of drawing the drag items yourself. It isn't too hard because if you already have the ownerdrawn code, then you just need to create an imagelist and create the image you want to draw and use that image list for the dragging code.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 50
MFC Dialog 9 49
Path of Workbook 3 77
Detect file exist or not 3 156
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question