>I'm triyng to use the TreeView with Drag & Drop capabilities, The HitTest never returns a Node (even using a factor - 15- in the coordinates), I use the DragOver if I move an external control and the OleDragOver if I try to move a node, in both cases the HitTest returns .null.. ??? (I'm using WinNT 4.0 and the Comctl32.ocx 5.01.4319.
>
>The CreateDragImage returns an image, and the DragIcon expects a CUR file.
>
>Does the EnsureVisible works to scroll the TreeView?
Hello Xan!
I didn't have much time to improve the TreeView Drag & Drop features since I wrote the message you've recovered. But a quick test showed me what Nick had already told us here: Even with the factor of 15, the HitTest is not working anymore (I suppose this is happening only with the newest version of Comctl32.ocx). That's something to be asked to MS...
Anyway, I'm still not using HitTest on my programs. But I could use CreateDragImage and DragIcon, so, as soon as possible, I'll have a look at them... Thanks!
About the use of EnsureVisible, I believe it's possible to scroll automatically the TreeView during a Drag & Drop operation (but also didn't have time to try it). I would try to put a control (maybe a shape or a container) over the top and over the bottom of the TreeView. Then in the MouseMove or MouseOver of that control the logic could be something like:
1- Enable a timer
2- If user is over there within a Drag operation during more than a specific time...
3- Catch the lowest index (or highest depending on which control you're over) of a visible Node.
4- EnsureVisible a specific number of Nodes with consecutive indexes before (or after) the index discovered on step 3.
5- Reset the timer
Does it help you to achieve what you want? Also let me know if you succeeded...
Regards,
Renato
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement