ListBox.DropObject not firing - I don't find its cause

DropObject is not firing on the target listbox.

I drag some text from one listbox A to listbox B.
In A I add the text with Drag.Text=varText

In B I have added Me.AcceptTextDrop to the Open eventhandler
DragEnter and DragOver events are firing as expected and I see the text is available.

The listbox is on a PagePanel inside of a container control.

What could prevent DropObject from firing?
Any known issues when a listbox is part of a containercontrol?

I am using Xojo 2019r3.2 on macOS Mojave 10.14.6

See the thread with this title:

Strange. DropObject not working on canvas in PagePanel

I found the cause. I simply had to raise the canvas to the top position.

1 Like

Unfortunately on this other thread there is neither a solution nor an explanation.

It used to work until Xojo 2019r1.1 and now with 3.x I first had issues with Listbox.DragOver and I found a feedback-case with information on how to rewrite my code.

But for ListBox.DropObject I have not found any hints about what might have changed. It just stopped working.

I doubt if it’s anything to do with the Listbox. In my case, I had a canvas inside a ContainerControl, on a page in the PagePanel. Drop worked on that until I added another page to the PP, with the entire page being filled with only an HTMLViewer. That was enough to stop my canvas, in the other PP page, from accepting a Drop.

I fixed that by putting the HTMLViewer in a CC. Nothing to do with the canvas, you see. I suggest you make sure that each PagePanel page is entirely contained within its own ContainerControl.

I’ve no idea why this worked, but it worked for me.

I don’t see how raising would apply for my case: a subclassed listbox on a pagepanel in a containercontrol


The Listboxes are entirely on the pagepanel. I did not add or remove anything to that containercontrol or the pagepanel. What has changed is Xojo plus the .AddItem code in .DragItem of another listbox, not on this container…

I expect they are. As I said, the Listbox, in itself, is unlikely to be the problem. I had a page on the PP that was intefering with another page on the PP. I fixed that by INSULATING the pages from each other by putting the content of each PP page in its own containercontrol.

You’ll have to fiddle about and experiment a bit to see whether what I’m suggesting works for you or not.

Did this interference occur on latest version of Xojo or already on 2019r1.1 or earlier?

That’s a good question. I should have submitted a Feedback about it, but it looks like I didn’t. I could put a test together and see.

Looks like I made an example project about this, four months ago. But, I didn’t find it at first, so I remade it. That one works in 2019r3.1 (i.e., no trouble with dropping a file).

HOWEVER: then I noticed my project from 4 months ago, tried it, that one fails in 2019r3.1, and also in 2019r1.1.

By fail I mean this: I have a pagepanel with two pages, Page zero has an HTMLViewer, which has top = 40. Page one has a canvas, with top = 0. No ContainerControls. If I drop a file near the top of the canvas, it is accepted. Drop it further down, it is not accepted.

Now I have to see (1) what is the difference between my two examples (both made with 2019r3.1), and (2) confirm that putting the HTMLViewer in a ContainerControl avoids the problem.

1 Like

OK now I see Matthew Jaques reply, which is correct and which explains the difference between my two examples. However this is just a different workaround, which should not be necessary. I’ll file a feedback.

1 Like

See feedback://showreport?report_id=61164.

1 Like