Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent to a property not fire with resetToDefault
Message
 
 
À
16/10/2003 12:01:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00839329
Message ID:
00839351
Vues:
16
This is just a wild assumption on my part, but after reading the VFP Help file on BindEvents PLUS the following from the ResetToDefault topic in the VFP Help file:

ResetToDefault does not apply to Access/Assign methods since these are tied more closely to their associated property and therefore are treated differently than normal methods.

I think this is by design. Try this demo code instead:
loTest = CREATEOBJECT("_label")
BINDEVENT(loTest, 'ResetToDefault', loTest, 'ResetFired', 1)
BINDEVENT(loTest, 'Caption', loTest, 'ChangeCaption', 1)
WITH loTest
   WAIT WINDOW "Caption = " + .Caption TIMEOUT 2
   .Caption = "Retest"
   .ResetToDefault('Caption')
   WAIT WINDOW "Reset Complete. Caption = " + .Caption TIMEOUT 2
ENDWITH

DEFINE CLASS _label AS label

   PROCEDURE ResetFired
      LPARAMETERS tuDummy
      WAIT WINDOW 'ResetToDefault fired' TIMEOUT 3
   ENDPROC
   PROCEDURE ChangeCaption
      WAIT WINDOW 'Caption Changed - Caption = ' + THIS.Caption TIMEOUT 3
   ENDPROC
   
ENDDEFINE
>Hi,
>
>is this a VFP by design behaviour ?
>
>Fabio
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform