Listbox dropobject confusion

I have 2 list boxes (see picture) Listbox1 holds files, listbox2 holds a hierarchy. I want to drop a row or multiple rows from listbox1 onto listbox2. The DragOver event from listbox2 fires, so I can follow over which rows the mouse is moving. But the DrobObject event from listbox2 doesn’t fire. I’m not really interested what is IN the drop, because I know already which rows were selected. I just need a trigger when the user release the drop. How to solve this?

Have you called AcceptRawDataDrop() or AcceptTextDrop() on the left listbox?

What I do for this situation is
a) Set Listbox 2 to Accept DropText
b) When you “pick up” from Listbox 1 create a dummy drag object that contains an obscure text phrase (so you can make sure someone isn’t dropping text from an external location)… drag_constant in example below

  d=New DragItem(Me,x,y,p.Width,p.Height,p)
  d.text=Trim(ConvertEncoding(drag_constant,Encodings.UTF8))
  d.drag
  If obj.TextAvailable Then 
    If obj.Text=drag_constant Then 

You wrote: [quote]But the DrobObject event from listbox2 doesn’t fire.[/quote] Do the DragEnter and DragOver event of listbox2 fire?

Are you creating a DragObject?

Also (and I got bit by this) … is there a PLACARD control anywhere on the screen? These seem to mess up the Drag Coordinates

[quote=61333:@Dave S]What I do for this situation is
a) Set Listbox 2 to Accept DropText
b) When you “pick up” from Listbox 1 create a dummy drag object that contains an obscure text phrase (so you can make sure someone isn’t dropping text from an external location)… drag_constant in example below

  d=New DragItem(Me,x,y,p.Width,p.Height,p)
  d.text=Trim(ConvertEncoding(drag_constant,Encodings.UTF8))
  d.drag

If obj.TextAvailable Then If obj.Text=drag_constant Then [/quote]
Hi Dave,

will try your suggestion today.

[quote=61340:@Dave S]Are you creating a DragObject?

Also (and I got bit by this) … is there a PLACARD control anywhere on the screen? These seem to mess up the Drag Coordinates[/quote]

Well, there is an object created by the drag event.
No placard, I never use it, there seems very little use for it.

[quote=61411:@Alexander van der Linden]Well, there is an object created by the drag event.
.[/quote]

Are you sure the dragobject is being created… it does contain TEXT… and the destination listbox was told it could accept it?

This is my code:

[code]Function DragRow(drag As DragItem, row As Integer) As Boolean
Drag.PrivateRawData(“text”) = Me.List(Row) + EndOfLine //get the text

Return True //allow the drag
End Function[/code]

Look at my example above…

plus WHERE is your code located within the app?

For Drag.PrivateRawData you have to call AcceptRawDataDrop() on listbox2, not AcceptTextDrop().

[code] Drag.PrivateRawData(“text”) = Me.List(Row) + EndOfLine //get the text

Return True //allow the drag[/code]

This code is in the DrawRow event of the Listbox FROM which I drag.

Take my code and put it int he the CELLCLICK…

It will never work in DRAWROW… that happens outside of your control

You mean the listbox that is accepting the drag?

In which event? The DropObject event?

Yes:
DragItem.FolderItem -> AcceptFileDrop
DragItem.Picture -> AcceptPictureDrop
DragItem.RawData -> AcceptRawDataDrop
DragItem.Text -> AcceptTextDrop

[quote=61506:@Eli Ott]Yes:
DragItem.FolderItem -> AcceptFileDrop
DragItem.Picture -> AcceptPictureDrop
DragItem.RawData -> AcceptRawDataDrop
DragItem.Text -> AcceptTextDrop[/quote]

Yes… it works… thanks very much!