Solved

Drag n Drop for CTreeCtrl

Posted on 1997-12-09
2
400 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.

763 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

7 Experts available now in Live!

Get 1:1 Help Now