Posted 19 years ago by Marianne
Avatar
Starting with 2.5, it seems that the DragDrop event is no longer firing--at least I can't get it to work. Even in the sample app, if you add the DragDrop event and have it either write out a debug statement or messagebox or whatever, it never fires.

I did notice in the release notes that you unsealed the DragXXX events. Does this mean to get this to work I need to override the DragDrop event from a derived class? Thanks.

------------------------------- Marianne

Comments (4)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marianne,

May I ask what specifically you need the DragDrop event for? We intend on you using the CustomDataObjectText event to handle drag/drops of custom objects since there is some really complicated code needed to handle the caret moving, etc.


Actipro Software Support

Posted 19 years ago by Marianne
Avatar
CustomDataObjectText gets me half-way to where I need to be.

If the user drops a file (i.e. FileDrop) then I want to present them with a box asking if they want to open that as a new file or insert the path of the file into the existing editor instance. Modifying the code from the sample app I get:
        private static void editor_CustomDataObjectText(object sender, CustomDataObjectTextEventArgs e) {
            if (e.DataObject.GetDataPresent(DataFormats.FileDrop)) {
                object files = e.DataObject.GetData(DataFormats.FileDrop);
                e.Text = "";
                if ((files is string[]) && (((string[])files).Length > 0)){
                    foreach(string file in (string[])files)
                        ' File Opening Code Here
                }
            }
        }
In this example, if it's a FileDrop then as soon as they drag into the Editor, the new file is opened; otherwise, everything works as usual. My problem is that I need an event that fires when the drop is occurring. CustomDataObjectText just allows you to view/modify what the dropped text will be, but that is fired before DragEnter is fired. I need something that I can hook into at the moment of the drop itself, not when they first begin dragging into the editor instance.

Let me know if that's clear enough. Thanks.

------------------------------- Marianne

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually, it fires on DragEnter and DragDrop. Look at the Source property in the event arguments to tell what caused it.


Actipro Software Support

Posted 19 years ago by Marianne
Avatar
Well... Then I guess I have no issues after all. Thanks!

------------------------------- Marianne

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.