Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I move a screen by using MOUSEDOWN?
Message
De
26/04/2013 13:28:01
 
 
À
26/04/2013 12:53:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01571991
Message ID:
01572007
Vues:
39
>>I have a form (dialog) withut a title bar
>>how can I allow users to move the form?

I dont follow.
Would you have a snippet I could study?

thanks

P
>
>Perhaps a better way to do it is to trap the MouseDown event on your form somewhere where there is no other event that's triggered, and then monitor MouseMove to see if the user is left-clicking for more than a few pixels. If so, then BINDEVENT(thisForm.hwnd, WM_MOUSEMOVE, thisForm, "myCustomMouseMoveEvent") and monitor those locations. Use the Windows function GetAsyncKeyState() to read the mouse button state (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293%28v=vs.85%29.aspx) and GetCursorPos() to find out where the mouse is on the entire desktop (http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390%28v=vs.85%29.aspx) and then begin reading mouse deltas from the original location and position your form adjusted by those deltas from its original position.
>
>Once the mouse button is released, UNBINDEVENT().
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform