Kevin, check out OBJTOCLIENT() function.
>I'm trying to implement drag & drop in a container. I want to allow
>the user to move a command button inside the container.
>
>The help for the MouseMove event says:
>
>"nXCoord, nYCoord - Contains the current horizontal (nXCoord) and vertical
>(nYCoord) position of the mouse pointer within the
form."
>
>So in the code below, how do I accuratly calculate the new position of the
>button so that it's always inside the container?
>
>
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>IF nButton = 1
>
> This.Top = nYCoord
> This.Left = nXCoord
>
> This.Drag()
>
>ENDIF
>
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison