How do I disable drag and drop on the root node only of a tree view control. I tried the following on the click event and also on mouse down:
If tvwInventory.SelectedItem.Root.Selected = True Then
tvwInventory.OLEDropMode = ccOLEDropNone
txtAddOrder.OLEDropMode = ccOLEDropNone
Else
tvwInventory.OLEDropMode = ccOLEDropManual
txtAddOrder.OLEDropMode = ccOLEDropManual
End If
But there are two problems with this, for some reason when the else fires it does not actually reactive the drop mode. I ran the program in debug and could see the value of OLEDropMode changing from O to 1, but it still wouldn't let me actually drop the item into the target.
Also, it only works if the user actually left clicks on the node before dragging. If they hold down the mouse and drag at the same time it doesn't fire at all and allows them to drag the root node (therefore, the whole tree) into the target.
Any help would be appreciated. Thanks.
If tvwInventory.SelectedItem.Root.Selected = True Then
tvwInventory.OLEDropMode = ccOLEDropNone
txtAddOrder.OLEDropMode = ccOLEDropNone
Else
tvwInventory.OLEDropMode = ccOLEDropManual
txtAddOrder.OLEDropMode = ccOLEDropManual
End If
But there are two problems with this, for some reason when the else fires it does not actually reactive the drop mode. I ran the program in debug and could see the value of OLEDropMode changing from O to 1, but it still wouldn't let me actually drop the item into the target.
Also, it only works if the user actually left clicks on the node before dragging. If they hold down the mouse and drag at the same time it doesn't fire at all and allows them to drag the root node (therefore, the whole tree) into the target.
Any help would be appreciated. Thanks.