1

I use a .NET richtextbox and I want to have the EnableAutoDragDrop property set to True. This allows user to drag&drop text, rtf and images around etc.

However, I need to process files dropped into the richtextbox myself - I do not want them to be embedded as OLE objects when they are dropped.

How can I overcome this? Is there any way to delete embedded files from richtextbox?

(I've found API DragAcceptFiles which doesn't work for some reason.)

Thanks!

Jiri
  • 264
  • 4
  • 17

2 Answers2

1

Try handling the DragDrop event.

Example.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Thanks for your answer. However, I already know how to do that. But I want EnableAutoDragDrop to be enabled, because it's nearly impossible to handle the drag&drop events the same way the control does by itself. The side effect is that when it's enabled, then the files that user drops there are embedded into the control, and I do not want that. – Jiri Mar 17 '10 at 18:06
0

You may try this MSDN article. If you do not wish to lock the file,you can use IO stream. Google it and It will sole your problem.

SOAMad
  • 325
  • 5
  • 22