Drag&Drop external text into ST Editor

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Nassim Farhat
Version: 4.0.0276
Avatar
Hello Team,

I'm trying to do something very simple. I want to allow drops from external modules outside the SE. Now I tried implementing the DragDrop and DragEnter events but they never gets raised, even after setting the AllowDrop = true, but still nothing!!!

I would like the following to happen:
1- on drag, if the item is dropable then change the mouse to a different picture to represeent that a drop is possible.
2- I want the carret to follow the drag movements in the text, so as to show the user where he can drop his text
3- When I drop I want my text to drop.

Would you have an example of this please, I looked thorugh all your forums and did not find relevant help, maybe I'm just not looking well enough.

Thank you
Nassim

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nassim,

In order to properly support drag/drop between views we handle those native events. We do however expose the PasteDragDrop event. Please see the documentation ("Custom DataObject Support" topic) on how to use that event.

The event args there give you access to the original DragEventArgs too so you can change the mouse probably there. We will handle caret if you return e.Text that is not null from that event handler. And setting e.Text tells us what to insert.

If you search for PasteDragDrop in our sample project I believe we have at least one example of using it.


Actipro Software Support

Posted 15 years ago by Nassim Farhat
Avatar
Again... you guys did it.... your the best!

Like you said, I used PasteDragDrop and extracted the string out of my custom oject that was I drag&droping into the SE, then I set that string = to e.Text and everything followed perfectly!

Thank you
Nassim
Posted 15 years ago by Nassim Farhat
Avatar
Again... you guys did it.... your the best!

Like you said, I used PasteDragDrop and extracted the string out of my custom oject that was I drag&droping into the SE, then I set that string = to e.Text and everything followed perfectly!

Thank you
Nassim
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.