Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form moving
Message
De
22/06/2009 14:05:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
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:
01407652
Vues:
41
>>>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
>>
>>
>>* Form.Moved()
>>DoDefault()
>>if This.Left < 0
>>	This.Left = 0
>>endif
>>
>>
>>The result looks weird, but the user can't move the form beyond the left edge, in this case.
>
>Yep,I have something like this and I got what I want, but the _screen flickering very ugly.
>I tried with _screen.LockScreen = .f. and with LockWindowUpdate() API w/o any luck -(

Here is my solution, with the Timer:
* Form.Moved()
with ThisForm.Timer1
	.Enabled = .T.
	.Reset()
endwith

* Form.Timer1:
.Enabled = .F.

.Interval = 500 && ms

* Timer Event:
This.Enabled = .F.
if ThisForm.Left < 0
	ThisForm.Left = 0
endif
You would have to add code for the other 3 screen borders.
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform