[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CListView: multi-sel dragging

Posted on 1997-11-11
3
Medium Priority
?
400 Views
Last Modified: 2013-11-19
In my owner-draw CListView, when I start dragging an element (in report view), I create the drag image by:

GetListCtrl().CreateDragImage(m_nDragIndex,&point);

but the resulting drag image includes only the bitmap and not the label text.

Besides this, I need to drag a multiple selection from as CListCtrl. The documentation only refers to a single-element drag (LVN_BEGINDRAG, CreateDragImage, etc..) How can I get the dragging image of a multiple selection?

Tnx

Fabio Marzocca
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
  • 2
3 Comments
 
LVL 8

Expert Comment

by:gelbert
ID: 1309773
When you drag more than one item then you have to use bitmap which is not associated with any of items on the list ( just keep custom bitmap in resources specially for this purpose and use it index in CreateDragImage() call). And if you really want to move text with bitmap when you do drag and drop then in OnMouseMove() or OnDraw() you have to draw/erase text near of current mouse position during drag and drop.
0
 
LVL 1

Author Comment

by:winmeister
ID: 1309774
I cannot have a custom bitmap for multi-sel, as it should be sized to the selection extension. I mean, I need to drag a multi-sel as Windows Explorer does in its right pane.

Concerning the text label, the example MFCDrag does not draw/erase text close to the mouse position, and the drag image is complete...
0
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 1309775
 Good news is that if you can use CListCtrl::RedrawItem() to paint item(bitmap+text) when it is draged. See mfcdrag sample, file listview.cpp function OnMouseMove().
    There is no function to call to get exactly the same effect as you see Windows Explorer. So you would have to try to use RedrawItem to display drag item(s). Otherwise you have to imitate drag and drop cursor by painting Explorer-like grid by yourseft.

0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

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