Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form moving
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01407630
Message ID:
01407689
Vues:
78
This message has been marked as the solution to the initial question of the thread.
>>>Is there a way to limit form to be moved above some point?
>>>Like when you dock a toolbar on top of the _screen and you can't move the form below it.
>>>I tried to put in Moved event this.Top = something but if tje use holds the mouse button and continue drag the mouse there is a very ugly flickering.
>>>TIA
>>
>>Borislav,
>>
>>As far as I understand, flickering is because mouse is still down. See if it is what you need:
>>
>>*Form.Moved
>>if This.Top < 100
>>  DECLARE mouse_event IN Win32API;
>>     INTEGER dwFlags, INTEGER dx,;
>>     INTEGER dy, INTEGER cButtons,;
>>     INTEGER dwExtraInfo
>>
>>*#define MOUSEEVENTF_LEFTUP      0x0004
>>	= mouse_event(0x0004, 0, 0, 0, 0)
>>
>>   CLEAR DLLS
>>
>>    this.Top = 100
>>	
>>ENDIF
>>
>
>Sure, that is one solution, but I want user still can move the form to the left or right, just not above some point :-)
>I'll not try to play with AdjustWindowRect API, but just started :-)

Then you may consider something like:

1. Create a blank form with no titlebar, say testarea.scx, and with form.top as needed to limit the area for your form, and with other dimensions suitable for your task
2. In your form.init add something like:
*-----------Form.Init-------------------------------
DO FORM testarea NAME testarea
DECLARE SetParent IN user32 integer hWndChild, integer hWndParent
SetParent(Thisform.HWnd,testarea.HWnd)
....
Hope you got the idea.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform