Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Firemonkey TTreeview always accepts a drag no matter what?!?

Permlink Replies: 0
Gord Bestwick

Posts: 4
Registered: 12/31/01
Firemonkey TTreeview always accepts a drag no matter what?!?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 10:05 AM

I'm running Delphi Seattle Update 1.

I've created a FIREMONKEY HD form and places a Treeview and a Listbox on it. I've not changed the DragMode/Allowdrag on the treeview at all.

Regardless of what I do with the ondragover, ondragdrop, the treeview ALWAYS accepts a dragged object. I say object, because if I drag from a listbox, it attempts to place a listboxitem on it. Or if I drop a file on it, it tries to drop a file on it. Often, with disastrous results.

So, this is what I want to accomplish, and maybe someone could help me.

I want to :
A) Have a list of items in a listbox/stringgrid/don't care what that when I grab and drag from it makes a COPY of it and doesn't steal the original.
B) Be able to control whether or not it is able to drop.

Things that don't appear to do anything:
A) Setting Operation to TDragOperation.Copy/None in OnDragOver does nothing.
B) Things are placed in it regardless of what code I put in the OnDragDrop event.

Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02