RichTextBox and dodragdrop

L

Lance Johnson

I seem to be having troubles implementing dragdrop on a richtextbox. I seem
to have been able to get the dropping part working fine when coming from an
external application. It's the dragging part.

It does seem to drag, but the icon always stays as None and I have no idea
why. I can see in my code on the drag enter for entering the other control
that it's set. However, the icon never changes and if I drop it, the
DragDrop event never fires. Am I missing something or do I need to
implement my own code for doing the drag operation?

Lance Johnson
 
J

Jeff Gaines

I seem to be having troubles implementing dragdrop on a richtextbox.
I seem to have been able to get the dropping part working fine when
coming from an external application. It's the dragging part.

It does seem to drag, but the icon always stays as None and I have no
idea why. I can see in my code on the drag enter for entering the
other control that it's set. However, the icon never changes and if
I drop it, the DragDrop event never fires. Am I missing something or
do I need to implement my own code for doing the drag operation?

Lance Johnson

You need to copy the dragged data to the Clipboard in an appropriate
format. I have just re-installed the OS on this PC so don't have access
to .NET at the moment but have a look at the help for Clipboard.SetData
(from memory).

If nobody else chimes in and you still have issues come back, I have a
couple of routines for setting the Clipboard in DROPFILES format and
the format Explorer expects to create shortcuts if that's of interest.

I will have .NET installed soon,none of my utilities work without it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top