VFP has events and properties specifically for drag-and-drop. You can use these. And it is really quite simple to use it.
The following sample involves a single form only.
Create two textboxes to a new form. Use the default names, Text1 and Text2.
Set Text1.DragMode = Automatic.
Put the following code in Text2.DragDrop():
LPARAMETERS oSource, nXCoord, nYCoord
if oSource.Name = "Text1"
This.Value = alltrim(This.Value) + space(1) + oSource.Value
endif
Run the form, type something in both textboxes, and drag Text1 to Text2.
HTH,
Hilmar.
>Hi all,
>I'm trying to figure out how to recognise when the left mouse button has been released over a different form than the one where the mouse was pressed. I'm trying to drag from a listbox on one from and drop something on a form in the class designer. Right now it sort of works. When I release over the class being designed, nothing happens until I click on the class. Then my mouseup code runs and adds the object. I think I have tried every combination of drag(), mousemove(), etc. and I can't seem to trap that event over another form until I click on that form. It's possible to do this because the toolbox does it, but I cannot for the life of me figure out how they trap this event. Any ideas? Thanks.
>
>Gary
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)