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
Solved

Drag n Drop for CTreeCtrl

Posted on 1997-12-09
2
410 Views
Last Modified: 2008-02-01
I have a class derived from CTreeCtrl and I want it to support OnDragOver and OnDropEx.  The wizard supports OnBeginDrag, but not OnDragOver or OnDrop.  What does it take?
0
Comment
Question by:Ashurbanipal
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1175612
You're supposed to handle the drag functions yourself. In this case, OnMouseMove and OnLButtonUp. When the BeginDrag gets called, you need to capture the mouse and set the cursor appropriately and set a flag.

Then in OnMouseMove, if the flag is set, you can highlight certain items by using selecting the drop target.

Finally, in OnLButtonUp, if the flag is set you can "drop" the items. But you need to do all of this yourself.
0
 

Author Comment

by:Ashurbanipal
ID: 1175613
I guessed this much.  CTreeView can do it, there doesn't seem to be a good reason for CTreeCtrl to lack the ability.  I suspect there is a way to do it, but am not going to waste any more time on it.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX StringGrid1->Canvas->FillRect Problem 3 169
Socket Programming (Unix) 8 139
How to convert MFC::CString to UTF8 wchar_t* 10 275
Safe conversion? 4 72
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

791 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