Solved

Drag&Drop in CListCtrl

Posted on 1997-11-30
1
689 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

707 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