Solved

Drag n Drop for CTreeCtrl

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ question 3 75
How can i compile this github project?? 2 99
Safe conversion? 4 76
How to Correctly derive class from CWinThread in MFC 4 89
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 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.

730 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