Re: Determine Treeview Node
I believe you want to use the .Hittest method. Refer to MSDN Help for a example using a Treeview
This simple example will display the node upon which something is dropped
private Sub TV_DragDrop(Source as Control, x as Single, y as Single)
Debug.print TV.HitTest(x, y)
End Sub
John G
Re: Determine Treeview Node
There is a treeview and textbox on the form, set the textbox OLEDragMode=Automatic
set the treeview OLEDropMode=ccOLEDropManual. Run the project, input any text in the textbox
select the characters in the textbox, drag&drop it on the root node of treeview.
Here is the code.
private Sub Form_Load()
TreeView1.Nodes.Add , , , "root"
End Sub
private Sub TreeView1_OLEDragDrop(Data as MSComctlLib.DataObject, Effect as Long, Button as Integer, Shift as Integer, x as Single, y as Single)
Dim tvwNode as Node
set tvwNode = TreeView1.HitTest(x, y)
Call TreeView1.Nodes.Add(tvwNode, tvwChild, , Data.GetData(1))
End Sub
//-----------------------------------------\\
Where there's a wire , there's a way
\\-----------------------------------------//