Set Effect value in TreeView's OLEDragDrop |
Post Reply |
Author | |
mjohn
Groupie Joined: 24 January 2011 Status: Offline Points: 24 |
Post Options
Thanks(0)
Posted: 10 June 2011 at 12:44pm |
Hi. In TreeView's TreeView's OLEDragDrop event whether set Effect = vbDropEffectMove or Effect = vbDropEffectMove, in the Source's OLECompleteDrag event Effect will get the same value, the set value to Effect in TreeView's OLEDragDrop event is invalid. Thanks! V15.0.1 VB6 SP6 Win7 |
|
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
|
I use code like this one. It's working ok for me.
|
|
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|
mjohn
Groupie Joined: 24 January 2011 Status: Offline Points: 24 |
Post Options
Thanks(0)
|
I modify your code as below: ------------------------------------------------------------------------------------------------------- Option Explicit Private Sub Form_Load() tvwExplorer.OLEDragMode = xtpOLEDragAutomatic tvwExplorer.OLEDropMode = xtpOLEDropManual tvwExplorer.Nodes.Add , , "node1", "node1" tvwExplorer.Nodes.Add , , "node2", "node2" tvwExplorer.Nodes.Add , , "node3", "node3" tvwExplorer.Nodes.Add , , "node4", "node4" End Sub Private Sub tvwExplorer_OLEStartDrag(Data As XtremeSuiteControls.DataObject, AllowedEffects As Long) Dim oDragNode As TreeViewNode If Not Me.tvwExplorer.SelectedItem Is Nothing Then ' check if valid ... AllowedEffects = vbDropEffectMove Else AllowedEffects = vbDropEffectNone End If End Sub Private Sub tvwExplorer_OLEDragDrop(ByVal Data As XtremeSuiteControls.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single) ' do what u need ' nothing about Effect If MsgBox("Select yes to set Effect = vbDropEffectMove, Select no to set Effect = vbDropEffectCopy ", vbYesNo, "Yes") = vbYes Then Effect = vbDropEffectMove Else Effect = vbDropEffectCopy End If End Sub Private Sub tvwExplorer_OLECompleteDrag(Effect As Long) MsgBox "result:" & IIf(Effect = vbDropEffectMove, "vbDropEffectMove", "vbDropEffectCopy"), vbOKOnly End Sub -------------------------------------------------------------------------------------------------------- Above code, in tvwExplorer_OLEDragDrop event, whether set Effect = vbDropEffectMove or set Effect = vbDropEffectCopy in tvwExplorer_OLECompleteDrag event, Effect always is vbDropEffectMove , this is not right, it should be the same as the value in tvwExplorer_OLEDragDrop . Thanks! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |