Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Drag/Drop on root node of treeview

Status
Not open for further replies.

anet

Programmer
Jul 10, 2001
35
CA
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top