Solved

Drag n Drop for CTreeCtrl

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 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

21 Experts available now in Live!

Get 1:1 Help Now