>VFP 5.0a
>I created two listboxes on a form with drag & drop capabilities.
>
>If the user drags an item from one listbox, but drops it back in the same listbox they dragged it from, I don't want anything to happen.
>
>In the following code, I am trying to say, "If the oSource object is the same object we are dropping on, do nothing."
>
>Can't objects be compared with the = sign?
>
>In the DragDrop event of each listbox I have the code:
>------------------------------------------------------
>LPARAMETERS oSource, nXCoord, nYCoord
>
>if oSource != this
> oSource.dblclick()
>endif
Leighton,
If the two lists are in the same container you can use;
IF THIS.Name = oSource.Name
If they are in different containers it gets more complex because they could have the same name, in this case;
IF THIS.Name = oSource.Name AND THIS.Parent.Name = oSource.Parent.Name
should do it for you
BTW, in VFP6 IF THIS = oSource works fine.