[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Drag&Drop in CListCtrl

Posted on 1997-11-30
1
Medium Priority
?
691 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 150 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 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