Solved

Drag&Drop in CListCtrl

Posted on 1997-11-30
1
682 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now