Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: how to avoid to drop item to itself for treeview?

$
0
0

Hi Kent,

 

In the example I posted last week I used an instance variable in the BeginDrag event, then in the dragdrop event check if the handle is not the same

 

 

treeview tvSource

treeviewitem ltvidropped, ltvidragged

 

 

tvSource = source

if draggedhandle > 0 and handle <> draggedhandle then

  tvSource.GetItem( draggedhandle , ltvidragged )

  this.GetItem( handle , ltvidropped)

  this.Insertitemsort( handle, ltvidragged )

  tvSource.Deleteitem( draggedhandle )

  draggedhandle = 0

end if

 

HTH

Lars


Viewing all articles
Browse latest Browse all 9236

Trending Articles