YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
View in English
View in Japanese
View in
참고
View in Français
View in Italiano
View in 中文(繁體)
Download Evaluation
Pricing & Purchase?
E-XD++Visual C++/ MFC Products
Overview
Features Tour 
Electronic Form Solution
Visualization & HMI Solution
Power system HMI Solution
CAD Drawing and Printing Solution

Bar code labeling Solution
Workflow Solution

Coal industry HMI Solution
Instrumentation Gauge Solution

Report Printing Solution
Graphical modeling Solution
GIS mapping solution

Visio graphics solution
Industrial control SCADA &HMI Solution
BPM business process Solution

Industrial monitoring Solution
Flowchart and diagramming Solution
Organization Diagram Solution

Graphic editor Source Code
UML drawing editor Source Code
Map Diagramming Solution

Architectural Graphic Drawing Solution
Request Evaluation
Purchase
ActiveX COM Products
Overview
Download
Purchase
Technical Support
  General Q & A
Discussion Board
Contact Us

Links

Get Ready to Unleash the Power of UCanCode .NET


UCanCode Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!

"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"


VC++ Article: CTreeCtrl, OLE Drag and Drop Copy between Tree controls

By Vinayak Tadas

This article demonstrates drag and drop between tree controls using OLE Drag and Drop. It also allows an item to be dropped on same tree control. When an item is dropped all the children of that item are also dropped on the target. The following key combination can be used:
  • Left button, to copy an item
  • Ctrl+Left Button,to copy an item
  • Shift+Left Button,to move an item

There are two classes :

  • CDragDropTreeCtrl, for Tree control. This class also has a helper function AddItem() for adding an item to the tree control.
  • CTreeDropTarget, which provides functionality of Drop target

The CDragDropTreeCtrl registers the tree control as the drop target and starts the drag operation in respose to the TVN_BEGINDRAG message.

The CTreeDropTarget is derived from COleDropTarget and serves as drop target. This class overides the following functions:

  • OnDragEnter().
  • OnDragOver(). This function highlights and expands the item under the mouse pointer and also scrolls the tree control appropriately
  • OnDrop(). This function creates the item being dragged in the destination tree control when the user releases the mouse button.
What you have to do You need to do the following things:
  • #include afxole.h in stdafx.h
  • Call AfxOleInit() in InitInstance().
  • Create an object of CDragDropTreeCtrl in your class.

Downloads

Download demo project - 18 Kb
Download source - 5 Kb

 

 

 

Copyright ?1998-2022 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net