Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run code when _Screen.resize runs???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00763834
Message ID:
00763844
Vues:
10
This message has been marked as the solution to the initial question of the thread.
>Is there a way in VFP7 to run some code when the _screen.resize() fires other than using an application timer and seeing if the .top, .left, .width, and .height of _screen has changed?
>Thanks.

You can create a class that "hooks" the _SCREEN object:
DEFINE CLASS myScreen AS Custom
oScrn = _SCREEN
FUNCTION oScrn.Resize
* whatever you need to do here.
ENDFUNC
ENDDEFINE
Then in the begining of your code, you can do:

* SET PROCEDURE or whatever is needed to locate the class
oMyScrn = CREATEOBJECT("myScreen")

Be warned that some people have experienced problems with this method, especially if ActiveX controls are involved, but it's worked for me.

I usually create a property on _SCREEN to hold the object reference.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform