Solved

Drag n Drop for CTreeCtrl

Posted on 1997-12-09
2
422 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
[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 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

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

688 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